[PATCH] D24307: calculate extent size for memory regions allocated by C++ new expression

Daniel Krupp via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 9 06:23:08 PDT 2016


dkrupp added inline comments.

================
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1011
@@ +1010,3 @@
+    // containing the elements.
+    Region = (State->getSVal(NE, LCtx))
+                 .getAsRegion()
----------------
MemRegion has now method called castAs<>, only getAs<>, so I stayed with it.

================
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1020
@@ +1019,3 @@
+  }
+  assert(Region);
+
----------------
I changed the type of Region to SubRegion, hope this is clearer this way.

================
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1043
@@ -988,3 +1042,3 @@
 void MallocChecker::checkPreStmt(const CXXDeleteExpr *DE,
                                  CheckerContext &C) const {
 
----------------
now inlined


https://reviews.llvm.org/D24307





More information about the cfe-commits mailing list