about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-10-21T09·18+0200
committertazjin <mail@tazj.in>2021-10-22T09·42+0000
commit33e71ba97fd3df598daa217ec36a48334136dcfc (patch)
tree1c792910f3c3d65517a592dce9eb8d8d2b199f2d /users/tazjin/rlox/src/bytecode/vm.rs
parent670662a360447509940dac417195cf419d7f42c5 (diff)
feat(tazjin/rlox): Implement else clauses r/2987
Change-Id: I0bc2333c0b4dd3e2e584a90d0d15b28c48130f03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3740
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/vm.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/vm.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/vm.rs b/users/tazjin/rlox/src/bytecode/vm.rs
index e0db97abe5a2..d287ec7cb8c5 100644
--- a/users/tazjin/rlox/src/bytecode/vm.rs
+++ b/users/tazjin/rlox/src/bytecode/vm.rs
@@ -213,6 +213,10 @@ impl VM {
                     panic!("unpatched jump detected - this is a fatal compiler error!");
                 }
 
+                OpCode::OpJump(offset) => {
+                    self.ip += offset.0;
+                }
+
                 OpCode::OpJumpIfFalse(offset) => {
                     if self
                         .stack