summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-09-23 08:58:14 +0000
committerKostya Serebryany <kcc@google.com>2013-09-23 08:58:14 +0000
commitb997c543fc844aaf42aea13e31456c62cb54d648 (patch)
treebe7c29c61b7c991e3ef1e72b1d6bfaba83d0d7fc
parent7915ff34b7022018cf03bf8f18b4a849bfab3b62 (diff)
downloadbcm5719-llvm-b997c543fc844aaf42aea13e31456c62cb54d648.tar.gz
bcm5719-llvm-b997c543fc844aaf42aea13e31456c62cb54d648.zip
[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.
llvm-svn: 191184
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc2
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc1
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/stack-use-after-return.cc1
3 files changed, 3 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index 39f4e515f5e..50e16691de3 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -153,7 +153,7 @@ void InitializeFlags(Flags *f, const char *env) {
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;
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc b/compiler-rt/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc
index 8bddb76cbee..572ca2d0ce9 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc
@@ -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 && \
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/stack-use-after-return.cc b/compiler-rt/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
index 09071b1982d..f74f50e4af6 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
@@ -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 && \
OpenPOWER on IntegriCloud