]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cc
1 // RUN: %clang_cl_asan -O0 %s -Fe%t
2 // RUN: not %run %t 2>&1 | FileCheck %s
13 void make_access(S
*s
) {
15 // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
16 // CHECK: READ of size {{[124]}} at [[ADDR]]
17 // CHECK: {{#0 .* make_access.*bitfield_uaf.cc}}:[[@LINE-3]]
18 // CHECK: {{#1 .* main}}
22 S
*s
= (S
*)malloc(sizeof(S
));
24 // CHECK: [[ADDR]] is located 0 bytes inside of 4-byte region
25 // CHECK-LABEL: freed by thread T0 here:
26 // CHECK: {{#0 .* free }}
27 // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-4]]
28 // CHECK-LABEL: previously allocated by thread T0 here:
29 // CHECK: {{#0 .* malloc }}
30 // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-8]]