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
+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
+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.
--- /dev/null
+// 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 ()
+{
+}
{
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)));
}