repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git]
/
compiler-rt
/
test
/
gwp_asan
/
use_after_delete.cpp
blob
d5b320d52a5f46af7a31dad4f1363132abb54675
1
// REQUIRES: gwp_asan
2
// RUN: %clangxx_gwp_asan %s -o %t
3
// RUN: %expect_crash %run %t 2>&1 | FileCheck %s
4
5
// CHECK: GWP-ASan detected a memory error
6
// CHECK: Use After Free at 0x{{[a-f0-9]+}} (0 bytes into a 1-byte allocation
7
8
#include <cstdlib>
9
10
int
main
() {
11
char
*
Ptr
=
new
char
;
12
13
*
Ptr
=
0x0
;
14
15
delete
Ptr
;
16
volatile
char
x
= *
Ptr
;
17
return
0
;
18
}