about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/mod.rs3
-rw-r--r--tvix/eval/src/value/thunk.rs7
2 files changed, 5 insertions, 5 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index fd5b5255c5..3791aaf56b 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -163,7 +163,8 @@ impl Value {
                         let call_to_string = |value: &Value, vm: &mut VM| {
                             // Leave self on the stack as an argument to the function call.
                             vm.push(self.clone());
-                            let result = vm.call_value(value)?;
+                            vm.call_value(value)?;
+                            let result = vm.pop();
 
                             match result {
                                 Value::String(s) => Ok(s),
diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs
index ed994ebd7d..7cb79dedc8 100644
--- a/tvix/eval/src/value/thunk.rs
+++ b/tvix/eval/src/value/thunk.rs
@@ -87,10 +87,9 @@ impl Thunk {
                         std::mem::replace(&mut *thunk_mut, ThunkRepr::Blackhole)
                     {
                         drop(thunk_mut);
-                        let evaluated = ThunkRepr::Evaluated(
-                            vm.call(lambda, upvalues, 0)
-                                .map_err(|e| ErrorKind::ThunkForce(Box::new(e)))?,
-                        );
+                        vm.enter_frame(lambda, upvalues, 0)
+                            .map_err(|e| ErrorKind::ThunkForce(Box::new(e)))?;
+                        let evaluated = ThunkRepr::Evaluated(vm.pop());
                         (*self.0.borrow_mut()) = evaluated;
                     }
                 }