re PR sanitizer/65004 (Compare debug failure with -fno-sanitize-recover -fsanitize=address -fsanitize=undefined)
PR sanitizer/65004 * ubsan.c (ubsan_expand_vptr_ifn): Always return true. * g++.dg/asan/pr65004.C: New test. From-SVN: r220596
This commit is contained in:
parent
2fdc039982
commit
c8aa1929d5
4 changed files with 59 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
48
gcc/testsuite/g++.dg/asan/pr65004.C
Normal file
48
gcc/testsuite/g++.dg/asan/pr65004.C
Normal file
|
@ -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 ();
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue