14 lines · cpp
1// RUN: %clang_cl_asan %Od %s %Fe%t2// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s3// UNSUPPORTED: asan-64-bits4#include <windows.h>5 6int main() {7 char *buffer;8 buffer = (char *)HeapAlloc(GetProcessHeap(), 0, 32),9 HeapFree(GetProcessHeap(), 0, buffer);10 buffer[0] = 'a';11 // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]12 // CHECK: WRITE of size 1 at [[ADDR]] thread T013}14