repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
pr105729.C
blob
fb6766309948615a36f1fbf508876828512deedb
1
// PR sanitizer/105729
2
// { dg-do run }
3
// { dg-options "-fsanitize=null -fno-sanitize-recover=null" }
4
5
int
6
foo (int x)
7
{
8
throw 0;
9
}
10
11
struct S {};
12
struct T {
13
S *data;
14
T () : data (0) {}
15
const S &bar (int x) const { return data[foo (x)]; }
16
};
17
18
int
19
main ()
20
{
21
T t;
22
try
23
{
24
t.bar (-1);
25
}
26
catch (...)
27
{
28
}
29
}