[PATCH] D85528: [analyzer] Fix cast evaluation on scoped enums in ExprEngine

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 9 02:53:40 PDT 2020


xazax.hun added a comment.

Looks reasonable to me, but I am not very familiar with the impacts of the additional casts. Do we lose some modeling power when we are using the regular constraint solver?

For example, when we have constraints both on the original and the cased symbol can the analyzer "merge" them?

Something like:

  ScopedPrimitive sym = conjure<ScopedPrimitive>();
  if (sym == ScopedPrimitive::Max)
    return;
  int sym2 = static_cast<unsigned char>(sym);
  if (sym2 == 0)
    return;
  // Do we know here that both sym and sym2 has the same range?
  // Is there a change in the behavior compared to before the patch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85528



More information about the cfe-commits mailing list