c++: vptr ubsan and object of known type [PR95466]
authorJason Merrill <jason@redhat.com>
Mon, 1 Jun 2020 20:20:38 +0000 (16:20 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 1 Jun 2020 20:52:47 +0000 (16:52 -0400)
commit172f2c42a10fd470c93f1e84575de9766c157591
treee169f2fb75548db8a27b015516eb95f0f97ce9b4
parent832c1192eba6dd100e2f757e30ea6373f782ff55
c++: vptr ubsan and object of known type [PR95466]

Another case where we can't find the OBJ_TYPE_REF_OBJECT in the
OBJ_TYPE_REF_EXPR.  So let's just evaluate the sanitize call first.

gcc/cp/ChangeLog:

PR c++/95466
PR c++/95311
PR c++/95221
* class.c (build_vfn_ref): Revert 95311 change.
* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
COMPOUND_EXPR.

gcc/testsuite/ChangeLog:

PR c++/95466
* g++.dg/ubsan/vptr-17.C: New test.
gcc/cp/class.c
gcc/cp/cp-ubsan.c
gcc/testsuite/g++.dg/ubsan/vptr-17.C [new file with mode: 0644]