re PR sanitizer/65004 (Compare debug failure with -fno-sanitize-recover -fsanitize...
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Feb 2015 22:00:11 +0000 (23:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Feb 2015 22:00:11 +0000 (23:00 +0100)
PR sanitizer/65004
* ubsan.c (ubsan_expand_vptr_ifn): Always return true.

* g++.dg/asan/pr65004.C: New test.

From-SVN: r220596

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/asan/pr65004.C [new file with mode: 0644]
gcc/ubsan.c

index 6be8626..ab9233f 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/65004
+       * ubsan.c (ubsan_expand_vptr_ifn): Always return true.
+
 2015-02-10  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/64661
index d7881d5..01dd398 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/65004
+       * g++.dg/asan/pr65004.C: New test.
+
 2015-02-10  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/64661
diff --git a/gcc/testsuite/g++.dg/asan/pr65004.C b/gcc/testsuite/g++.dg/asan/pr65004.C
new file mode 100644 (file)
index 0000000..78cb204
--- /dev/null
@@ -0,0 +1,48 @@
+// PR sanitizer/65004
+// { dg-do compile }
+// { dg-options "-fcompare-debug -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all" }
+
+namespace N {
+  template <typename Signature> struct function;
+  namespace detail {
+    namespace function {
+      struct vtable_base { };
+    }
+  }
+  struct function_base {
+    detail::function::vtable_base * vtable;
+  };
+  template <typename R, typename T0> struct function1 : public function_base { };
+  template <typename R, typename T0> struct function <R (T0)> : public function1 <R, T0> { };
+}
+namespace Bar {
+  typedef N::function <void (const char *)> WarningHandler;
+}
+namespace Foo {
+  struct FooRecord {
+    virtual ~FooRecord ();
+  };
+  struct TestRecord : public FooRecord {
+    long x;
+  };
+}
+namespace Foo {
+  using Bar::WarningHandler;
+  struct FooScanner {
+    WarningHandler warnHandler;
+    int readByte ();
+    long readSignedInteger ();
+  };
+  struct FooRecordReader {
+    FooScanner & scanner;
+    long readSInt ();
+    void readTestRecord (TestRecord * recp);
+  };
+  inline long FooRecordReader::readSInt () {
+    return scanner.readSignedInteger ();
+  }
+  void FooRecordReader::readTestRecord (TestRecord * recp) {
+    int infoByte = scanner.readByte ();
+    recp->x = readSInt ();
+  }
+}
index 036e67e..2c1030c 100644 (file)
@@ -1148,7 +1148,7 @@ ubsan_expand_vptr_ifn (gimple_stmt_iterator *gsip)
   /* Get rid of the UBSAN_VPTR call from the IR.  */
   unlink_stmt_vdef (stmt);
   gsi_remove (&gsi, true);
-  return gsi_end_p (*gsip);
+  return true;
 }
 
 /* Instrument a memory reference.  BASE is the base of MEM, IS_LHS says