================
@@ -715,7 +717,11 @@ void ExprEngine::handleConstructor(const Expr *E,
         // actually make things worse. Placement new makes this tricky as well,
         // since it's then possible to be initializing one part of a multi-
         // dimensional array.
-        State = State->bindDefaultZero(Target, LCtx);
+        const CXXRecordDecl *TargetHeldRecord =
+            Target.getType(Ctx)->getPointeeCXXRecordDecl();
----------------
ziqingluo-90 wrote:

Thanks for the comments!
yeah, I'm aware that `SVal::getType` could return something not accurate as NoQ 
pointed out in a different page.  What I was thinking is:
- If `SVal::getType`  is conservative, regardless of how inaccurate it is, we 
will be fine to use it.
- If we avoid using SVal::getType`, its improvement will come slowly.

But you guys are right that we should not take the risk in the core engine.  
I'll fix it.


https://github.com/llvm/llvm-project/pull/138594
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to