From dddbf77faca83022760f42c61a34835187f6190a Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 5 Oct 2024 21:30:48 -0400 Subject: [PATCH] Fix bug in the VM --- dust-lang/src/vm.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dust-lang/src/vm.rs b/dust-lang/src/vm.rs index 75a86bc..43e9df5 100644 --- a/dust-lang/src/vm.rs +++ b/dust-lang/src/vm.rs @@ -255,7 +255,7 @@ impl Vm { self.ip += 1; } else { let jump_distance = jump.a(); - let is_positive = jump.a_as_boolean(); + let is_positive = jump.b_as_boolean(); let new_ip = if is_positive { self.ip + jump_distance as usize } else { @@ -286,7 +286,7 @@ impl Vm { self.ip += 1; } else { let jump_distance = jump.a(); - let is_positive = jump.a_as_boolean(); + let is_positive = jump.b_as_boolean(); let new_ip = if is_positive { self.ip + jump_distance as usize } else { @@ -316,7 +316,7 @@ impl Vm { self.ip += 1; } else { let jump_distance = jump.a(); - let is_positive = jump.a_as_boolean(); + let is_positive = jump.b_as_boolean(); let new_ip = if is_positive { self.ip + jump_distance as usize } else {