PR sanitizer/65019
* ubsan.c (ubsan_expand_objsize_ifn): Always return true.
* g++.dg/ubsan/pr65019.C: New test.
From-SVN: r220641
2015-02-12 Jakub Jelinek <jakub@redhat.com>
+ PR sanitizer/65019
+ * ubsan.c (ubsan_expand_objsize_ifn): Always return true.
+
PR tree-optimization/65014
* fold-const.c (fold_binary_loc): When creating {L,R}ROTATE_EXPR,
use original second operand of arg0 or arg1 instead of
2015-02-12 Jakub Jelinek <jakub@redhat.com>
+ PR sanitizer/65019
+ * g++.dg/ubsan/pr65019.C: New test.
+
PR tree-optimization/65014
* gcc.c-torture/compile/pr65014.c: New test.
--- /dev/null
+// PR sanitizer/65019
+// { dg-do compile }
+// { dg-options "-fsanitize=alignment,object-size,vptr -std=c++11 -O2 -fcompare-debug" }
+
+struct A { };
+struct B { };
+struct C final {
+ C (const A &, int);
+ static B *foo (const A &, int = 1);
+ virtual ~C ();
+ void *c;
+};
+
+B *
+C::foo (const A &x, int y)
+{
+ C *d = new C (x, y);
+ if (d->c == nullptr)
+ delete d;
+}
+
+C::~C ()
+{
+}
/* Get rid of the UBSAN_OBJECT_SIZE call from the IR. */
unlink_stmt_vdef (stmt);
gsi_remove (&gsi_orig, true);
- return gsi_end_p (*gsi);
+ return true;
}
/* Cached __ubsan_vptr_type_cache decl. */