Sign in
gnu
/
gcc
/
d769c5040874bf9546f2524f3f1d2a894165f92a
/
.
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
vptr-14.C
blob: 06cd66347d4d61b4d98e13aac295af9a770f48d7 [
file
] [
log
] [
blame
]
// PR sanitizer/89869
// { dg-do run { target c++11 } }
// { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
struct
S
{
S
*
s
=
0
;
virtual
~
S
()
{}
};
void
foo
(
S
*
x
,
S
*
y
)
{
(
x
->
s
?
y
:
x
)
=
x
->
s
;
}
int
main
()
{
S a
;
foo
(&
a
,
0
);
}