[clang] [analyzer] performTrivialCopy triggers checkLocation before binding (PR #129016)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 06:19:28 PST 2025


================
@@ -69,14 +69,19 @@ void ExprEngine::performTrivialCopy(NodeBuilder &Bldr, ExplodedNode *Pred,
 
   assert(ThisRD);
   SVal V = Call.getArgSVal(0);
+  const Expr *VExpr = Call.getArgExpr(0);
 
   // If the value being copied is not unknown, load from its location to get
   // an aggregate rvalue.
   if (std::optional<Loc> L = V.getAs<Loc>())
     V = Pred->getState()->getSVal(*L);
   else
     assert(V.isUnknownOrUndef());
-  evalBind(Dst, CallExpr, Pred, ThisVal, V, true);
+
+  ExplodedNodeSet Tmp;
+  evalLocation(Tmp, CallExpr, VExpr, Pred, Pred->getState(), V, true);
----------------
steakhal wrote:

Shouldn't we only dispatch this load event if an actual load happened?
The `getSVal(*L)` was guarded by a condition, but this `checkLocation` is not.

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


More information about the cfe-commits mailing list