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

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 10 10:18:31 PST 2017


vsk added a comment.

Ah, I did miss ParenExpr. Maybe it would be better to use Expr::isImplicitCXXThis, since it handles this case and some more. Later, we can go back and see if it's feasible to handle static/const casts in isImplicitCXXThis to catch more cases.

In https://reviews.llvm.org/D29530#671816, @arphaman wrote:

> Btw, you mentioned that 'this' must have been null-checked before the method is called. But what if it's called from some part of code that was compiled without `-fsanitize=null`? Wouldn't we still want at least one check to see if 'this' is null in a method?


That's fair, I think that would address the concerns about the partial sanitization use case brought up in the original PR.


https://reviews.llvm.org/D29530





More information about the cfe-commits mailing list