Fix bug in the VM
This commit is contained in:
parent
79cc59c952
commit
dddbf77fac
@ -255,7 +255,7 @@ impl Vm {
|
|||||||
self.ip += 1;
|
self.ip += 1;
|
||||||
} else {
|
} else {
|
||||||
let jump_distance = jump.a();
|
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 {
|
let new_ip = if is_positive {
|
||||||
self.ip + jump_distance as usize
|
self.ip + jump_distance as usize
|
||||||
} else {
|
} else {
|
||||||
@ -286,7 +286,7 @@ impl Vm {
|
|||||||
self.ip += 1;
|
self.ip += 1;
|
||||||
} else {
|
} else {
|
||||||
let jump_distance = jump.a();
|
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 {
|
let new_ip = if is_positive {
|
||||||
self.ip + jump_distance as usize
|
self.ip + jump_distance as usize
|
||||||
} else {
|
} else {
|
||||||
@ -316,7 +316,7 @@ impl Vm {
|
|||||||
self.ip += 1;
|
self.ip += 1;
|
||||||
} else {
|
} else {
|
||||||
let jump_distance = jump.a();
|
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 {
|
let new_ip = if is_positive {
|
||||||
self.ip + jump_distance as usize
|
self.ip + jump_distance as usize
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user