diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-05-02 23:12:04 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-05-02 23:12:04 +0000 |
commit | 9102fc20f8e3d89b27d91a23a9a50ae32bf403c4 (patch) | |
tree | 1305907dfcc9ec3ad5c9334509cc6d8d43ca630f /compiler-rt | |
parent | 3199c4e1efe3b92e383518170cde914fd0c6792a (diff) | |
download | bcm5719-llvm-9102fc20f8e3d89b27d91a23a9a50ae32bf403c4.tar.gz bcm5719-llvm-9102fc20f8e3d89b27d91a23a9a50ae32bf403c4.zip |
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
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/asan/TestCases/use-after-scope-chars.cc | 15 |
1 files changed, 15 insertions, 0 deletions
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 00000000000..cc983a7cbe3 --- /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 +} |