[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 14:23:42 PST 2017


vsk marked 2 inline comments as done.
vsk added inline comments.


================
Comment at: test/CodeGenCXX/ubsan-suppress-null-checks.cpp:8
+  int load_member() {
+    // CHECK: call void @__ubsan_handle_type_mismatch
+    // CHECK-NOT: call void @__ubsan_handle_type_mismatch
----------------
arphaman wrote:
> I think this kind of check would've passed even when this patch is not applied. I understand that you need the first check for the single 'this' check, but it should be rewritten to ensure that it couldn't be the check for the `return foo`. Maybe you could use a C label before return and then check that the 'this' check is performed before the label?
Yes, this check should be tighter. This just checks that the number of checks in the method goes from 2 to 1. The label idea is great.


https://reviews.llvm.org/D29530





More information about the cfe-commits mailing list