about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 9f4b6b411a72..1f6dae95ac12 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1096,10 +1096,9 @@ void EvalState::callPrimOp(Value & fun, Value & arg, Value & v, const Pos & pos)
 
 void EvalState::callFunction(Value & fun, Value & arg, Value & v, const Pos & pos)
 {
-    std::optional<FunctionCallTrace> trace;
-    if (evalSettings.traceFunctionCalls) {
-        trace.emplace(pos);
-    }
+    std::unique_ptr<FunctionCallTrace> trace;
+    if (evalSettings.traceFunctionCalls)
+        trace = std::make_unique<FunctionCallTrace>(pos);
 
     forceValue(fun, pos);