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

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 16 13:38:41 PST 2016


pcc added inline comments.


================
Comment at: lib/CodeGen/CGExprCXX.cpp:1769
+  SourceLocation CallLoc;
+  if (DE)
+    CallLoc = DE->getExprLoc();
----------------
DE will always be non-null at this point.


================
Comment at: test/CodeGenCXX/ubsan-vtable-checks.cpp:23
+  // CHECK-NULL: [[UBSAN_CMP_RES:%[0-9]+]] = icmp ne %struct.T* %{{[_a-z0-9]+}}, null
+  // CHECK-NULL-NEXT: br i1 [[UBSAN_CMP_RES]], label %cont, label %handler.type_mismatch
+  // CHECK-NULL: call void @__ubsan_handle_type_mismatch_abort
----------------
Does this test pass in a -Asserts build?


https://reviews.llvm.org/D26559





More information about the cfe-commits mailing list