=?utf-8?q?Donát?= Nagy <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -562,8 +562,12 @@ std::optional<SVal> 
CallEvent::getReturnValueUnderConstruction() const {
 
   EvalCallOptions CallOpts;
   ExprEngine &Engine = getState()->getStateManager().getOwningEngine();
+  // FIXME: This code assumes that the _current_ location context and block is
+  // the location and block where this `CallExpr` is called. For a more stable
+  // solution `Engine.getNumVisitedCurrent()` should be replaced with a call to
+  // `Engine.getNumVisited(<CallerLCtx>, <CallerBlock>)`.
----------------
haoNoQ wrote:

Yes I think you're right, this is a bug. We're lucky that our `CallEvent` 
objects are usually short-lived. But that's definitely a hazard.

This function should always return the same value regardless of the internal 
state of `ExprEngine`: the actual return location of the call. Regardless of 
whether the call is about to be evaluated, or in the middle of being evaluated, 
or has just been evaluated, or has been evaluated a long time ago. Even if 
simulation is already finished and we're in a `BugReporterVisitor` we should 
still get the same value every time we call that function. It has to be the 
actual location that was, or is, or will be used during simulation.

https://github.com/llvm/llvm-project/pull/186186
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to