Skip to content

Commit 9102fc2

Browse files
committed
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
1 parent 3199c4e commit 9102fc2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clangxx_asan -O1 -mllvm -asan-use-after-scope=1 %s -o %t && \
2+
// RUN: not %run %t 2>&1 | FileCheck %s
3+
// XFAIL: *
4+
5+
// FIXME: This works only for arraysize <= 8.
6+
7+
char *p = 0;
8+
9+
int main() {
10+
{
11+
char x[1024] = {};
12+
p = x;
13+
}
14+
return *p; // BOOM
15+
}

0 commit comments

Comments
 (0)