mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-02 05:40:26 +08:00
re PR sanitizer/60569 (Segfault with -flto and -fsanitize=undefined)
PR sanitizer/60569 * ubsan.c (ubsan_type_descriptor): Check that DECL_NAME is nonnull before accessing it. testsuite/ * g++.dg/ubsan/pr60569.C: New test. From-SVN: r208681
This commit is contained in:
parent
bd99727761
commit
6daa2d914b
@ -1,3 +1,9 @@
|
||||
2014-03-19 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR sanitizer/60569
|
||||
* ubsan.c (ubsan_type_descriptor): Check that DECL_NAME is nonnull
|
||||
before accessing it.
|
||||
|
||||
2014-03-19 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR lto/59543
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-03-19 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR sanitizer/60569
|
||||
* g++.dg/ubsan/pr60569.C: New test.
|
||||
|
||||
2014-03-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* gcc.dg/tls/pr58595.c: Require tls_runtime instead of tls.
|
||||
|
21
gcc/testsuite/g++.dg/ubsan/pr60569.C
Normal file
21
gcc/testsuite/g++.dg/ubsan/pr60569.C
Normal file
@ -0,0 +1,21 @@
|
||||
// PR sanitizer/60569
|
||||
// { dg-do link }
|
||||
// { dg-require-effective-target lto }
|
||||
// { dg-options "-fsanitize=undefined -flto" }
|
||||
|
||||
struct A
|
||||
{
|
||||
void foo ();
|
||||
struct
|
||||
{
|
||||
int i;
|
||||
void bar () { i = 0; }
|
||||
} s;
|
||||
};
|
||||
|
||||
void A::foo () { s.bar (); }
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
}
|
@ -318,7 +318,7 @@ ubsan_type_descriptor (tree type, bool want_pointer_type_p)
|
||||
{
|
||||
if (TREE_CODE (TYPE_NAME (type2)) == IDENTIFIER_NODE)
|
||||
tname = IDENTIFIER_POINTER (TYPE_NAME (type2));
|
||||
else
|
||||
else if (DECL_NAME (TYPE_NAME (type2)) != NULL)
|
||||
tname = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type2)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user