[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 02:45:32 PDT 2024


NagyDonat wrote:

Oh, you're right, invalid pointer arithmetic like `(&x - 1)` is not handled by ArrayBoundV2, because right now that's the responsibility of a THIRD checker, `alpha.core.PointerArithm`.

However, directly after bringing `ArrayBoundV2` out of alpha, I'll continue with working on this `PointerArithm` and either I'll completely merge it with `ArrayBoundV2` or I'll keep it as a separate "frontend" which also calls the bounds-checking logic that's behind `ArrayBoundV2`.

Based on this I'd suggest that you should
- delete the bounds checking logic from `PointerSubChecker`,
- delete the testcases that were testing it (because it would be too complicated to bring in *two* other checkers + AFAIK `PointerArithm` is in a bad shape currently),
- refer to both ArrayBoundV2 and PointerArithm in the documentation.

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


More information about the cfe-commits mailing list