Alexey Samsonov | 6016486 | 2012-08-15 08:29:17 +0000 | [diff] [blame^] | 1 | // RUN: %clang_asan -m64 -O2 %s -o %t |
2 | // RUN: %t 2>&1 | %symbolizer | FileCheck %s | ||||
3 | |||||
4 | #include <string.h> | ||||
5 | int main(int argc, char **argv) { | ||||
6 | char x[10]; | ||||
7 | memset(x, 0, 10); | ||||
8 | int res = x[argc * 10]; // BOOOM | ||||
9 | // CHECK: {{READ of size 1 at 0x.* thread T0}} | ||||
10 | // CHECK: {{ #0 0x.* in main .*stack-overflow.cc:8}} | ||||
11 | // CHECK: {{Address 0x.* is .* frame <main>}} | ||||
12 | return res; | ||||
13 | } |