1
0

Fix bug in the VM

This commit is contained in:
Jeff 2024-10-05 21:30:48 -04:00
parent 79cc59c952
commit dddbf77fac

View File

@ -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 {