diff options
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r-- | tvix/eval/src/vm.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index e32c0d7f6b62..c55bc81777f1 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -136,7 +136,7 @@ impl VM { self.frames.push(frame); } - fn run(&mut self) -> EvalResult<Value> { + pub fn run(&mut self) -> EvalResult<Value> { #[cfg(feature = "disassembler")] let mut tracer = Tracer::new(); @@ -441,6 +441,16 @@ impl VM { self.populate_upvalues(upvalue_count, upvalues)?; } + OpCode::OpForce => { + let mut value = self.pop(); + + while let Value::Thunk(thunk) = value { + value = thunk.force(self)?.clone(); + } + + self.push(value); + } + OpCode::OpFinalise(StackIdx(idx)) => { match &self.stack[self.frame().stack_offset + idx] { Value::Closure(closure) => closure |