From e46a2ce3efd085d6e4a899d9dbc225c09c3ffd16 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 27 Aug 2022 23:30:26 +0300 Subject: fix(tvix/eval): account for stack offset when pushing a `with` scope Change-Id: I4b98eaea3ed5059c29938a117a9d59499a0bb95d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6318 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/vm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index 5b6536e98664..23d9c3555153 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -323,7 +323,10 @@ impl VM { self.push(self.stack[idx].clone()); } - OpCode::OpPushWith(StackIdx(idx)) => self.with_stack.push(idx), + OpCode::OpPushWith(StackIdx(idx)) => { + self.with_stack.push(self.frame().stack_offset + idx) + } + OpCode::OpPopWith => { self.with_stack.pop(); } -- cgit 1.4.1