[PATCH] D66161: [SLC] Dereferenceable annonation - handle valid null pointers

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 14:53:22 PDT 2019


jdoerfert added a comment.

In D66161#1627965 <https://reviews.llvm.org/D66161#1627965>, @reames wrote:

> In D66161#1627898 <https://reviews.llvm.org/D66161#1627898>, @jdoerfert wrote:
>
> > I'm fine with this, @reames ?
>
>
> Definitely not.  I've never seen that utility on Function, but whatever it's supposed to do, it completely ignores address spaces (our major source of defined nulls) while doing it.


The utility function can take a address space and it is used in other places too. To give it the address spaces of the argument pointers would be an option, but ...

> A much simpler surgical fix would be to replace the use of getDereferenceableOrNullBytes with getDereferenceableBytes.  This would eliminate the "or null concern" from the merge logic.
> 
> Johannes, I didn't take time to fully understand your concern, but if it's broader than the above, please revert the original patch and handle in normal review.

... we can, as @reames noted, not change the `_or_null` part at all and only work on the `deref(X)` parts.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66161/new/

https://reviews.llvm.org/D66161





More information about the llvm-commits mailing list