[PATCH] D36112: [ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't available

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 11:00:54 PDT 2017


vsk marked an inline comment as done.
vsk added a comment.

In https://reviews.llvm.org/D36112#828891, @arphaman wrote:

> That makes sense. It's kinda weird not to report the `null`, but I guess it makes sense if the `null` sanitiser is off.


It is kinda weird, but any such diagnostic would fit better under -fsanitize=null, and that's explicitly not enabled.

> It's not actually UB unless it's dereferenced, right, so casts are allowed?

Right, even the null sanitizer doesn't issue reports when it finds an {up,down}cast of null.

@arphaman thanks for taking a look! I've fixed the test case issue you pointed out and added minor comment and doc updates. I'll go ahead and commit to unblock Nico.


https://reviews.llvm.org/D36112





More information about the cfe-commits mailing list