[PATCH] D131006: [analyzer] Use DisequalityMap while inferring constraints

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 10:59:21 PDT 2022


ASDenysPetrov added a comment.

@martong 
This solution has an essential logical mistake. It relies on the erroneous assumption that
if `x > 0 && x != y` then `y` is in range `[MIN, 0]` but that's **not** true.
`x` and `y` could be `1` and `2` respectively.

My idea will only work with concrete ints but not ranges and it is already implemented in `RangeConstraintManager` in the snippet you mentioned (`ConstraintAssignor::assign`).

I'm sorry for the lost time.

P.S. The best I can do is just to add more tests for this. I will requalificate the revision.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131006/new/

https://reviews.llvm.org/D131006



More information about the cfe-commits mailing list