[clang] [analyzer] Avoid use of `CallEvent`s with obsolete state (PR #160707)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 7 07:47:30 PDT 2025


================
@@ -670,35 +674,40 @@ void ExprEngine::finishArgumentConstruction(ExplodedNodeSet &Dst,
 }
 
 void ExprEngine::evalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred,
-                          const CallEvent &Call) {
-  // WARNING: At this time, the state attached to 'Call' may be older than the
-  // state in 'Pred'. This is a minor optimization since CheckerManager will
-  // use an updated CallEvent instance when calling checkers, but if 'Call' is
-  // ever used directly in this function all callers should be updated to pass
-  // the most recent state. (It is probably not worth doing the work here since
-  // for some callers this will not be necessary.)
+                          const CallEvent &CallTemplate) {
+  // WARNING: As this function performs transitions between several different
+  // states (perhaps in a branching structure) we must be careful to avoid
+  // referencing obsolete or irrelevant states. In particular, 'CallEvent'
+  // instances have an attached state (because this is is convenient within the
----------------
NagyDonat wrote:

Done in https://github.com/llvm/llvm-project/pull/160707/commits/16490339f0f9da77b715d8508586fdba3a534fe3

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


More information about the cfe-commits mailing list