[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 02:08:07 PDT 2023


================
@@ -264,7 +264,8 @@ ProgramStateRef ExprEngine::handleLValueBitCast(
   }
   // Delegate to SValBuilder to process.
   SVal OrigV = state->getSVal(Ex, LCtx);
-  SVal V = svalBuilder.evalCast(OrigV, T, ExTy);
+  SVal SimplifiedOrigV = svalBuilder.simplifySVal(state, OrigV);
+  SVal V = svalBuilder.evalCast(SimplifiedOrigV, T, ExTy);
----------------
steakhal wrote:

Did you try to simplify after the cast?
To me, it would make more sense to bind a simplified value.
However, I also know that casts are weird at best :D

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


More information about the cfe-commits mailing list