[clang] [analyzer] Implement potential underflow warnings (PR #216077)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 24 07:05:18 PDT 2026
================
@@ -492,8 +491,7 @@ void ArrayBoundChecker::handleAccessExpr(const Expr *E,
if (isTainted(State, ASE->getIdx(), C.getStackFrame()))
OffsetName = "index";
- BugDescription Desc =
- describeTaintBug(RegName, OffsetName, Res.mayUnderflow());
+ BugDescription Desc = describeTaintBug(Res, RegName, OffsetName);
reportOOB(C, State, Desc, ByteOffset, Extent, /*IsTaintBug=*/true);
----------------
NagyDonat wrote:
Good point, corrected the behavior and added your regression test in https://github.com/llvm/llvm-project/pull/216077/commits/1d865c792e9b7a4663c7cc1c861aa1d50a1db0aa
By the way, IIRC something like this was already implemented in one of the earlier versions of the "split out the bounds checking library" change, but it was lost in the back and forth changes.
https://github.com/llvm/llvm-project/pull/216077
More information about the cfe-commits
mailing list