[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 17 03:33:47 PST 2025
NagyDonat wrote:
> That being said, I wonder if we should record the presence of casts when we produce `ElementRegion`s to better help checks suppress potentially false results. This would just make some workarounds easier to write rather than having full modelling.
After stabilizing the other bounds checking checkers (PointerArithm, ReturnPtrRange etc.), I'll start another "big project" (probably later this year), and for that my primary idea is that I'll try to improve the handling of symbols -- which would include proper cast modeling as one of the main goals. I hope that this could be one of the rare situations where I can apply my theoretical mathematics skills for something practical by designing a more accurate representation/architecture without sacrificing the performance.
I wrote this particular workaround because it was a low-hanging fruit (as I'm already familiar with the ArrayBound code), but I wouldn't want to spend time on systematically burdening more checkers with similar hacks.
https://github.com/llvm/llvm-project/pull/127117
More information about the cfe-commits
mailing list