view gcc/testsuite/g++.dg/ubsan/vptr-14.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// PR sanitizer/89869
// { dg-do run }
// { 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);
}