[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 12:10:10 PDT 2024


================
@@ -791,3 +791,30 @@ void global_ptr_to_ptr() {
   *global_pp = nullptr;
 }
 } // namespace leaking_via_indirect_global_invalidated
+
+namespace not_leaking_via_simple_ptr {
+void top(const char *p) {
----------------
steakhal wrote:

Please add a ref case too.
And also one for taking a struct by value and having this pointer as a member, and a similar with ref.

https://github.com/llvm/llvm-project/pull/107003


More information about the cfe-commits mailing list