about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-27T20·30+0300
committertazjin <tazjin@tvl.su>2022-09-06T07·29+0000
commite46a2ce3efd085d6e4a899d9dbc225c09c3ffd16 (patch)
tree2faacf9bd060d7bf38f30d220c4f7d6b2b5c711e /tvix/eval/src
parentae531a2245e83d44ce58ba6c588713265984dbbf (diff)
fix(tvix/eval): account for stack offset when pushing a `with` scope r/4654
Change-Id: I4b98eaea3ed5059c29938a117a9d59499a0bb95d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6318
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/vm.rs5
1 files changed, 4 insertions, 1 deletions
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();
                 }