NoQ added inline comments.

================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:288
+    // this-region of the parent stack frame).
+    if (dyn_cast_or_null<InitListExpr>(LCtx->getParentMap().getParent(CE))) {
+      MemRegionManager &MRMgr = getSValBuilder().getRegionManager();
----------------
a.sidorin wrote:
> Could we try to make another lookup to see if we're initializing a variable 
> of non-reference type? If so, we can make MemRegionManager use the region of 
> the variable; otherwise, we can always fallback to temporary (it seems like 
> sometimes this situation can happen out of DeclStmts). Or am I missing 
> something?
Yeah, that's what we do in other cases, i guess that's the shortest way to go. 
As usual, it would be way better if we just knew this stuff from, like, CFG. 
Maybe transform the constructor CFGElement from StmtElement to a better element 
that has a pointer to the parent expression that represents the object that's 
being constructed.


https://reviews.llvm.org/D40841



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to