[PATCH] D40560: [analyzer] Get construction into `operator new` running in simple cases.

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 16:48:38 PST 2018


dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.

LGTM with the TODO and the test case I requested inline.



================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:487
+    if (const MemRegion *MR = I.second.getAsRegion())
+      SymReaper.markElementIndicesLive(MR);
+  }
----------------
Do we have a test for the MemRegion case? Commenting it out doesn't seem to affect the tests.


================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:607
+    const CXXConstructExpr *CtorExpr = Ctor.getOriginExpr();
+    const Stmt *ParentExpr = CurLC->getParentMap().getParent(CtorExpr);
+
----------------
Can you add a TODO saying that we really shouldn't be using the parent map here? That is fragile and is a sign we're not providing enough context.



https://reviews.llvm.org/D40560





More information about the cfe-commits mailing list