From 9102fc20f8e3d89b27d91a23a9a50ae32bf403c4 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 2 May 2016 23:12:04 +0000 Subject: [PATCH] Add another failing use-after-scope test Summary: Use after scope is not detected if array larger then 8 bytes. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19572 llvm-svn: 268330 --- compiler-rt/test/asan/TestCases/use-after-scope-chars.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 compiler-rt/test/asan/TestCases/use-after-scope-chars.cc diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-chars.cc b/compiler-rt/test/asan/TestCases/use-after-scope-chars.cc new file mode 100644 index 0000000..cc983a7 --- /dev/null +++ b/compiler-rt/test/asan/TestCases/use-after-scope-chars.cc @@ -0,0 +1,15 @@ +// RUN: %clangxx_asan -O1 -mllvm -asan-use-after-scope=1 %s -o %t && \ +// RUN: not %run %t 2>&1 | FileCheck %s +// XFAIL: * + +// FIXME: This works only for arraysize <= 8. + +char *p = 0; + +int main() { + { + char x[1024] = {}; + p = x; + } + return *p; // BOOM +} -- 2.7.4