[PATCH] D60047: [CaptureTracking] Don't let comparisons against null escape inbounds pointers

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 07:56:10 PDT 2019


jdoerfert added a comment.

I again think `dereferenceable_or_null` is fine because you basically have a single shot to guess the pointer by making it `null`:

Any guess (with an offset) that keeps it in the `dereferenceable` part is useless as it cannot be `null`.
Any guess that brings it outside the `dereferenceable` part which is not `null` will trigger undefined behavior (IMHO).
Left is only the single guess that is just right which I would not count as escaping because the program could just as well
take the guessed value and pretend it is the pointer value without the check.

Does this make sense?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60047





More information about the llvm-commits mailing list