[PATCH] D30599: [ubsan] Extend the nonnull argument check to ObjC

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 3 20:54:49 PST 2017


vsk added a comment.

In https://reviews.llvm.org/D30599#692210, @jroelofs wrote:

> Can the null check be performed in the callee?


Yes, but I think that would result in perplexing diagnostics, because we wouldn't be able to report the source location of the buggy calls.

> That'd make this check work for a few more cases that this patch doesn't cover:
> 
> - `performSelector:` messages
> - messages to `id`.

That's a good point, but sadly I don't see a way to diagnose these situations well with the current check. I think the best we can do is to check for nullability violations on assignment/return. I will upload a nullability "sanitizer" for review soon that does this.


https://reviews.llvm.org/D30599





More information about the cfe-commits mailing list