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

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 09:28:17 PST 2017


alexshap added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:192
+          this, "Address of stack-allocated memory is captured");
+    SmallString<512> Buf;
+    llvm::raw_svector_ostream Out(Buf);
----------------
xazax.hun wrote:
> How long usually these error messages are? Maybe 512 is a bit large buffer for this? Note that in case the error message is longer this is still not a hard error, it just will hit the slow path (allocating the buffer on the heap).
>Note that in case the error message is longer this is still not a hard error, it just will hit the slow path

thanks, i'm aware of that. 
512 was used in this file before my invasion,
the size obviously depends on what genName would generate (and inherently depends on the code style of the codebase)


Repository:
  rL LLVM

https://reviews.llvm.org/D39438





More information about the cfe-commits mailing list