[PATCH] D40841: [analyzer] Fix a crash on C++17 AST for non-trivial construction into a trivial brace initializer.

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 09:42:02 PST 2017


a.sidorin 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();
----------------
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?


https://reviews.llvm.org/D40841





More information about the cfe-commits mailing list