diff options
author | Martin Liska <mliska@suse.cz> | 2017-11-15 13:40:07 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-11-15 12:40:07 +0000 |
commit | 86a9e738370e25b9ddb1d444fd99f9173309ce19 (patch) | |
tree | 07131b1f694f395d026b42b45bbb2c27dc970360 /gcc/cp | |
parent | 134d23547e10276280b1022c4463cc1f52bab831 (diff) | |
download | gcc-86a9e738370e25b9ddb1d444fd99f9173309ce19.zip gcc-86a9e738370e25b9ddb1d444fd99f9173309ce19.tar.gz gcc-86a9e738370e25b9ddb1d444fd99f9173309ce19.tar.bz2 |
Fix fallout of -fsanitize=vptr.
2017-11-15 Martin Liska <mliska@suse.cz>
* decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
instead of cp_build_indirect_ref.
From-SVN: r254765
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 578299e..839042e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2017-11-15 Martin Liska <mliska@suse.cz> + * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref + instead of cp_build_indirect_ref. + +2017-11-15 Martin Liska <mliska@suse.cz> + * decl.c (begin_destructor_body): In case of VPTR sanitization (with disabled recovery), zero vptr in order to catch virtual calls after lifetime of an object. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 041893d..7e16f7b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -15253,8 +15253,7 @@ begin_destructor_body (void) { tree binfo = TYPE_BINFO (current_class_type); tree ref - = cp_build_indirect_ref (current_class_ptr, RO_NULL, - tf_warning_or_error); + = cp_build_fold_indirect_ref (current_class_ptr); tree vtbl_ptr = build_vfield_ref (ref, TREE_TYPE (binfo)); tree vtbl = build_zero_cst (TREE_TYPE (vtbl_ptr)); |