[PATCH] D90341: Use deref facts derived from minimum object size of allocations

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 11:15:01 PST 2020


reames added a comment.

In D90341#2410925 <https://reviews.llvm.org/D90341#2410925>, @nikic wrote:

> The logic here looks sound to me. Structurally, I would suggest integrating this with the getPointerDereferenceableBytes() check above, as you are currently duplicating the logic around it. Basically extract the current getPointerDereferenceableBytes() call into a static function/lambda, and add the handling for the allocated object size in there, the remaining logic (including the non-null check and the alignment check) will be shared.

Doing it this way will greatly increase the scope of the analysis done for object size.  I would expect it to be compile time prohibitive.  The restriction to only calls was tactical and intentional.


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

https://reviews.llvm.org/D90341



More information about the llvm-commits mailing list