diff options
author | Marek Polacek <polacek@redhat.com> | 2014-04-08 17:23:26 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-04-08 17:23:26 +0000 |
commit | 6525783a221d88ef4e89a8e9dd01c7bfd82ec711 (patch) | |
tree | f72b1bf22ec131aeaa36f1a0cf036521e9c3e8ab /gcc | |
parent | e2e6026693a6c0481ea9ee2d7b2fd34430c7d436 (diff) | |
download | gcc-6525783a221d88ef4e89a8e9dd01c7bfd82ec711.zip gcc-6525783a221d88ef4e89a8e9dd01c7bfd82ec711.tar.gz gcc-6525783a221d88ef4e89a8e9dd01c7bfd82ec711.tar.bz2 |
re PR sanitizer/60745 (Many ICEs running libstdc++ testsuite with ubsan, maybe due to PCH)
PR sanitizer/60745
* c-ubsan.c: Include asan.h.
(ubsan_instrument_return): Call initialize_sanitizer_builtins.
From-SVN: r209222
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-ubsan.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index e2b0474..152c3b7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-04-08 Marek Polacek <polacek@redhat.com> + + PR sanitizer/60745 + * c-ubsan.c: Include asan.h. + (ubsan_instrument_return): Call initialize_sanitizer_builtins. + 2014-04-03 Nathan Sidwell <nathan@codesourcery.com> * c.opt (Wnon-virtual-dtor): Auto set when Weffc++. diff --git a/gcc/c-family/c-ubsan.c b/gcc/c-family/c-ubsan.c index dc4d981..e89ebc1 100644 --- a/gcc/c-family/c-ubsan.c +++ b/gcc/c-family/c-ubsan.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "ubsan.h" #include "c-family/c-common.h" #include "c-family/c-ubsan.h" +#include "asan.h" /* Instrument division by zero and INT_MIN / -1. If not instrumenting, return NULL_TREE. */ @@ -185,6 +186,10 @@ ubsan_instrument_vla (location_t loc, tree size) tree ubsan_instrument_return (location_t loc) { + /* It is possible that PCH zapped table with definitions of sanitizer + builtins. Reinitialize them if needed. */ + initialize_sanitizer_builtins (); + tree data = ubsan_create_data ("__ubsan_missing_return_data", &loc, NULL, NULL_TREE); tree t = builtin_decl_explicit (BUILT_IN_UBSAN_HANDLE_MISSING_RETURN); |