[PATCH] D23112: [analyzer] Correctly add assumptions based on array bounds.
Artem Dergachev via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 18 05:32:45 PDT 2016
NoQ added a comment.
On second thought, in `RangeConstraintManager` we need a different functionality. In particular, from `4 * x < 1000` it does not follow that `x < 250` in the general case (due to possible overflows). But in the case of this checker, it doesn't matter - we are always sure that any valid array address is never overflowing even when converted to bytes.
That said, it is still boilerplate. Some day i wish to consider adding the non-overflowing versions of common operations into the `SValBuilder`'s `evalBinOp()`, so that it could help checkers simplify various symbolic expressions. In my opinion, `evalBinOp()` should be as user-friendly as possible.
But that's another story, your approach looks good to me!
https://reviews.llvm.org/D23112
More information about the cfe-commits
mailing list