Commit 86a9e738 by Martin Liska Committed by Martin Liska

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
parent 134d2354
2017-11-15 Martin Liska <mliska@suse.cz> 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 * decl.c (begin_destructor_body): In case of VPTR sanitization
(with disabled recovery), zero vptr in order to catch virtual calls (with disabled recovery), zero vptr in order to catch virtual calls
after lifetime of an object. after lifetime of an object.
......
...@@ -15253,8 +15253,7 @@ begin_destructor_body (void) ...@@ -15253,8 +15253,7 @@ begin_destructor_body (void)
{ {
tree binfo = TYPE_BINFO (current_class_type); tree binfo = TYPE_BINFO (current_class_type);
tree ref tree ref
= cp_build_indirect_ref (current_class_ptr, RO_NULL, = cp_build_fold_indirect_ref (current_class_ptr);
tf_warning_or_error);
tree vtbl_ptr = build_vfield_ref (ref, TREE_TYPE (binfo)); tree vtbl_ptr = build_vfield_ref (ref, TREE_TYPE (binfo));
tree vtbl = build_zero_cst (TREE_TYPE (vtbl_ptr)); tree vtbl = build_zero_cst (TREE_TYPE (vtbl_ptr));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment