[compiler-rt] f59311e - Mark lambda in use-after-scope-capture.cpp as noinline

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 09:03:56 PDT 2020


Author: Arthur Eubanks
Date: 2020-06-05T09:03:38-07:00
New Revision: f59311e31dec9d439819d38353ac9fb098f9547b

URL: https://github.com/llvm/llvm-project/commit/f59311e31dec9d439819d38353ac9fb098f9547b
DIFF: https://github.com/llvm/llvm-project/commit/f59311e31dec9d439819d38353ac9fb098f9547b.diff

LOG: Mark lambda in use-after-scope-capture.cpp as noinline

Summary:
As explained in https://bugs.llvm.org/show_bug.cgi?id=46208,
symbolization on Windows after inlining and around
lambdas/std::functions doesn't work very well. Under the new pass
manager, there is inlining at -O1.
use-after-scope-capture.cpp checks that the symbolization points to the
line containing "return x;", but the combination of
Windows/inlining/lambdas makes the symbolization point to the line
"f = [&x]() {".

Mark the lambda as noinline since this test is not a test for
symbolization.

Reviewers: hans, dblaikie, vitalybuka

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D81193

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
index 5e93dbb48eba..319d20519e7c 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
@@ -7,7 +7,7 @@ int main() {
   std::function<int()> f;
   {
     int x = 0;
-    f = [&x]() {
+    f = [&x]() __attribute__((noinline)) {
       return x;  // BOOM
       // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
       // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]


        


More information about the llvm-commits mailing list