From c77f22310ae6724b95d638be51dde19a7da46643 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 18 Dec 2018 03:25:34 -0800 Subject: [PATCH] [pulse] rewrite test to avoid stack variable address escape Summary: Pulse is about to be smart enough to detect that bug. Reviewed By: da319 Differential Revision: D13466895 fbshipit-source-id: 79afd2d51 --- infer/tests/codetoanalyze/cpp/pulse/use_after_destructor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/tests/codetoanalyze/cpp/pulse/use_after_destructor.cpp b/infer/tests/codetoanalyze/cpp/pulse/use_after_destructor.cpp index 8175ec7e5..948331f8f 100644 --- a/infer/tests/codetoanalyze/cpp/pulse/use_after_destructor.cpp +++ b/infer/tests/codetoanalyze/cpp/pulse/use_after_destructor.cpp @@ -247,7 +247,8 @@ std::unique_ptr* allocate_in_branch_ok(bool b) { a3 = &a2; } - return a3; + // read a3 + const B* read = (*a3)->f; } } // namespace use_after_destructor