NoQ added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:842-849
+      if (Optional<CallExitEnd> CEE = Node->getLocationAs<CallExitEnd>())
         if (CEE->getCalleeContext()->getCallSite() == S)
           break;
-      if (auto SP = Node->getLocationAs<StmtPoint>())
-        if (SP->getStmt() == S)
-          break;
+
+      if (!IsBypass)
+        if (Optional<StmtPoint> SP = Node->getLocationAs<StmtPoint>())
+          if (SP->getStmt() == S)
----------------
Comparing statements is usually insufficient because the same statement may 
appear multiple times due to recursion. When recursion occurs, you may reach 
the same statement in a different location context. You should think in terms 
of (statement, location context) pairs to avoid these problems. Your aim here 
is to find the `CallExitEnd` node that corresponds to returning from an inlined 
operator new to the current location context. You should stop searching when 
you find an unrelated statement in the current location context or when you 
exit the current location context entirely.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62926/new/

https://reviews.llvm.org/D62926



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

Reply via email to