about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-26T17·54+0300
committertazjin <tazjin@tvl.su>2022-09-03T13·22+0000
commitc73e84d95777c304f1b208cbc43b01012df73262 (patch)
tree88efee3ba7d312afd5f9cc3875b960172aadd99d /tvix/eval/src/vm.rs
parent2cdc6192b47dbba221d158de31800035c738fdc7 (diff)
refactor(tvix/eval): add opcode::StackIdx type for less ambiguity r/4621
Change-Id: I9b9de1f681972c205d4d20bc5731d2ce79858edb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6287
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index a74051a64975..28b1636488af 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -6,7 +6,7 @@ use std::rc::Rc;
 use crate::{
     chunk::Chunk,
     errors::{ErrorKind, EvalResult},
-    opcode::{JumpOffset, OpCode},
+    opcode::{JumpOffset, OpCode, StackIdx},
     value::{Closure, Lambda, NixAttrs, NixList, Value},
 };
 
@@ -318,13 +318,13 @@ impl VM {
                     }
                 }
 
-                OpCode::OpGetLocal(local_idx) => {
+                OpCode::OpGetLocal(StackIdx(local_idx)) => {
                     let idx = self.frame().stack_offset + local_idx;
                     let value = self.stack[idx].clone();
                     self.push(value)
                 }
 
-                OpCode::OpPushWith(idx) => self.with_stack.push(idx),
+                OpCode::OpPushWith(StackIdx(idx)) => self.with_stack.push(idx),
                 OpCode::OpPopWith => {
                     self.with_stack.pop();
                 }