[compiler-rt] r191184 - [asan] disable the detect_stack_use_after_return run-time flag by default and enable it explicitly in tests. This is done in preparation to enabling the -fsanitize=use-after-return compile-time flag by default when -fsanitize=address is present.
Kostya Serebryany
kcc at google.com
Mon Sep 23 01:58:15 PDT 2013
Author: kcc
Date: Mon Sep 23 03:58:14 2013
New Revision: 191184
URL: http://llvm.org/viewvc/llvm-project?rev=191184&view=rev
Log:
[asan] disable the detect_stack_use_after_return run-time flag by default and enable it explicitly in tests. This is done in preparation to enabling the -fsanitize=use-after-return compile-time flag by default when -fsanitize=address is present.
Modified:
compiler-rt/trunk/lib/asan/asan_rtl.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=191184&r1=191183&r2=191184&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Mon Sep 23 03:58:14 2013
@@ -153,7 +153,7 @@ void InitializeFlags(Flags *f, const cha
f->replace_str = true;
f->replace_intrin = true;
f->mac_ignore_invalid_free = false;
- f->detect_stack_use_after_return = true; // Also needs the compiler flag.
+ f->detect_stack_use_after_return = false; // Also needs the compiler flag.
f->max_malloc_fill_size = 0x1000; // By default, fill only the first 4K.
f->malloc_fill_byte = 0xbe;
f->exitcode = ASAN_DEFAULT_FAILURE_EXITCODE;
Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc?rev=191184&r1=191183&r2=191184&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc Mon Sep 23 03:58:14 2013
@@ -1,3 +1,4 @@
+// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
// RUN: %clangxx_asan -fsanitize=use-after-return -O0 %s -o %t && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -fsanitize=use-after-return -O2 %s -o %t && \
Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc?rev=191184&r1=191183&r2=191184&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc Mon Sep 23 03:58:14 2013
@@ -1,3 +1,4 @@
+// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
// RUN: %clangxx_asan -fsanitize=use-after-return -O0 %s -o %t && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -fsanitize=use-after-return -O1 %s -o %t && \
More information about the llvm-commits
mailing list