[PATCH] D39438: [analyzer] Diagnose stack leaks via block captures

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 03:44:13 PDT 2017


xazax.hun added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:145
+      if (dyn_cast_or_null<StackSpaceRegion>(Region->getMemorySpace())) {
+        ExplodedNode *N = C.generateErrorNode();
+        if (!N)
----------------
This will stop the analysis on this execution path. Is this desired? Usually, we stop the execution when there is no way to model the program state after the error, e.g.: after a division by zero. In this case the stack address escaped but it wasn't dereferenced (yet), so I think it might be safe to continue the analysis on this path.  What do you think?


================
Comment at: lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:156
+               "asynchronously";
+        auto report =
+            llvm::make_unique<BugReport>(*BT_capturestackleak, Out.str(), N);
----------------
The variable should start with an uppercase letter.


Repository:
  rL LLVM

https://reviews.llvm.org/D39438





More information about the cfe-commits mailing list