Fix fallout of -fsanitize=vptr.
authorMartin Liska <mliska@suse.cz>
Wed, 15 Nov 2017 12:40:07 +0000 (13:40 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 15 Nov 2017 12:40:07 +0000 (12:40 +0000)
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

gcc/cp/ChangeLog
gcc/cp/decl.c

index 578299ef0e26b16d594356418f67b8b9094fb4d5..839042e48c6b29ae6d08e6ee0fbd41e6a21a2379 100644 (file)
@@ -1,3 +1,8 @@
+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
index 041893db937443a5f7d9302a202c8769981d0ba4..7e16f7b415bb079666f59e834ab20a545597db5d 100644 (file)
@@ -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));