Zero vptr in dtor for -fsanitize=vptr.
authorMartin Liska <mliska@suse.cz>
Wed, 15 Nov 2017 07:01:01 +0000 (08:01 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 15 Nov 2017 07:01:01 +0000 (07:01 +0000)
commit896f6b3dfa6fb337109f97bed8d74c1e030c965e
treecf440ff8306354ca1233cc796105d1c100583a0d
parent2a6fc98713d6f9b98d186a52ffc3160819bd580e
Zero vptr in dtor for -fsanitize=vptr.

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.
2017-11-15  Martin Liska  <mliska@suse.cz>

* g++.dg/ubsan/vptr-12.C: New test.

From-SVN: r254754
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/vptr-12.C [new file with mode: 0644]