[PATCH] D126481: [analyzer] Handle SymbolCast in SValBuilder

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 09:22:43 PDT 2022


ASDenysPetrov added a comment.

@martong

> Then we can iterate onto the solution. What we could do is to collect the constants and types on the way of the cast visitation and then apply the same logic that you have in D103096 <https://reviews.llvm.org/D103096>.

Suppose we have found the way to handle it. But what if we find a contradiction while simplifying, like `(short)(int x) = 0` and `(int x) = 1`. So that we would already know that it is impossible. What `SVal` should we return in such case? Undef? Unknown? Original one?

> But then there is an open question: what should we do if there is another kind of symbol in the chain of SymbolCasts? E.g SymbolCast, UnarySymExpr, SymbolCast.

IMO, it doesn't matter, since we are just waiting for a constant. Doesn't matter to what `Sym` it is associated. The main question, as I said, what we shall do with two different constants.

Do you have any ideas?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126481



More information about the cfe-commits mailing list