[llvm] [InstCombine] Support gep nuw in icmp folds (PR #118472)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 03:16:02 PST 2024


zmodem wrote:

> > Could UBSan flag pointer arithmetic overflows?
> 
> UBSan should already flag this.

Oh that's good. I guess we need to run it some more :-)

> > Could ASan flag comparisons of invalid pointers?
> 
> Not sure what exactly you have in mind here.

I was thinking that ASan could use the shadow memory to detect when one operand is pointing to bad memory which is more than one element past valid memory. That way we could perhaps catch (some) instances of

```
if (ptr + idx > end_ptr)
```

Not sure if that's really practical though, and it still requires test coverage to catch anything.





https://github.com/llvm/llvm-project/pull/118472


More information about the llvm-commits mailing list