[clang] [analyzer] EvalBinOpLL should return Unknown less often (PR #114222)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 06:17:05 PDT 2024


Xazax-hun wrote:

> To me, simplifying a SymbolRef should never result in Unknown or Undef, unless it was Unknown or Undef initially or, during simplification we realized that it's a division by zero once we did the constant folding, etc.

I understand that we might not be ready for this, but feels like at some point we should have this as a form of an assertion. I am not sure about the `Undef` part because there are many ways to get to undef during constant folding (signed overflows, division by zero, OOB access of an array, defer of an invalid pointer). Even if some of those cannot happen during the current simplification they might be modeled later. So, I think a simpler "the result can only be Unknown if the input was also Unknown" would make a lot of sense to me. 

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


More information about the cfe-commits mailing list