]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/deep_stack_uaf.cc
1 // Check that we can store lots of stack frames if asked to.
3 // RUN: %clangxx_asan -O0 %s -o %t 2>&1
4 // RUN: %env_asan_opts=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
5 // XFAIL: arm-linux-gnueabi
6 // XFAIL: armv7l-unknown-linux-gnueabihf
12 static void free(char *x
) {
13 DeepFree
<depth
- 1>::free(x
);
19 static void free(char *x
) {
25 char *x
= (char*)malloc(10);
27 DeepFree
<200>::free(x
);
29 // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
30 // The libcxxrt demangling procedure on FreeBSD 9.2 incorrectly appends
31 // extra 'E' characters to the end of template arguments; see:
32 // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192115
33 // CHECK: {{DeepFree<36>|DeepFree<36E>}}
34 // CHECK: {{DeepFree<98>|DeepFree<98E>}}
35 // CHECK: {{DeepFree<115>|DeepFree<115E>}}