[PATCH] [analyzer][Review request] Fix for PR18394.

Антон Ярцев anton.yartsev at gmail.com
Thu Feb 27 18:18:29 PST 2014


Hi jordan_rose, zaks.anna, krememek,

Attached is the patch that fixes PR18394. This fixes at least one of false-positives produced by the alpha.cplusplus.NewDeleteLeaks checker run over the LLVM codebase. The detailed explanation of what is happening is in my comment to PR18394: http://llvm.org/bugs/show_bug.cgi?id=18394#c1

http://llvm-reviews.chandlerc.com/D2899

Files:
  lib/StaticAnalyzer/Core/ExplodedGraph.cpp

Index: lib/StaticAnalyzer/Core/ExplodedGraph.cpp
===================================================================
--- lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -90,8 +90,8 @@
   // (7) The LocationContext is the same as the predecessor.
   // (8) Expressions that are *not* lvalue expressions.
   // (9) The PostStmt isn't for a non-consumed Stmt or Expr.
-  // (10) The successor is not a CallExpr StmtPoint (so that we would
-  //      be able to find it when retrying a call with no inlining).
+  // (10) The successor is neither a CallExpr StmtPoint nor a CallEnter (so that
+  //      we would be able to find it when retrying a call with no inlining).
   // FIXME: It may be safe to reclaim PreCall and PostCall nodes as well.
 
   // Conditions 1 and 2.
@@ -152,6 +152,9 @@
   if (Optional<StmtPoint> SP = SuccLoc.getAs<StmtPoint>())
     if (CallEvent::isCallStmt(SP->getStmt()))
       return false;
+
+  if (SuccLoc.getAs<CallEnter>())
+    return false;
 
   return true;
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2899.1.patch
Type: text/x-patch
Size: 1038 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140227/c18e6088/attachment.bin>


More information about the cfe-commits mailing list