[PATCH] D26559: Insert a type check before reading vtable.

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 16 15:47:21 PST 2016


pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/CodeGen/CGExprCXX.cpp:1768
                              QualType ElementType) {
+  CGF.EmitTypeCheck(CodeGenFunction::TCK_MemberCall,
+                    DE->getExprLoc(), Ptr.getPointer(),
----------------
You could cite C++11 [expr.delete]p3 here:

"if the static type of the object to be deleted is different from its
dynamic type, the static type shall be a base class of the dynamic type of the object to be deleted and the
static type shall have a virtual destructor or the behavior is undefined."


https://reviews.llvm.org/D26559





More information about the cfe-commits mailing list