Skip to content

Commit f924128

Browse files
authored
Merge pull request #1569 from sogaiu/vm-bug-1566
2 parents 7c38a55 + 18c00e8 commit f924128

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/vm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -798,14 +798,14 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
798798
vm_pcnext();
799799

800800
VM_OP(JOP_JUMP)
801-
pc += DS;
802801
vm_maybe_auto_suspend(DS <= 0);
802+
pc += DS;
803803
vm_next();
804804

805805
VM_OP(JOP_JUMP_IF)
806806
if (janet_truthy(stack[A])) {
807-
pc += ES;
808807
vm_maybe_auto_suspend(ES <= 0);
808+
pc += ES;
809809
} else {
810810
pc++;
811811
}
@@ -815,15 +815,15 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
815815
if (janet_truthy(stack[A])) {
816816
pc++;
817817
} else {
818-
pc += ES;
819818
vm_maybe_auto_suspend(ES <= 0);
819+
pc += ES;
820820
}
821821
vm_next();
822822

823823
VM_OP(JOP_JUMP_IF_NIL)
824824
if (janet_checktype(stack[A], JANET_NIL)) {
825-
pc += ES;
826825
vm_maybe_auto_suspend(ES <= 0);
826+
pc += ES;
827827
} else {
828828
pc++;
829829
}
@@ -833,8 +833,8 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
833833
if (janet_checktype(stack[A], JANET_NIL)) {
834834
pc++;
835835
} else {
836-
pc += ES;
837836
vm_maybe_auto_suspend(ES <= 0);
837+
pc += ES;
838838
}
839839
vm_next();
840840

0 commit comments

Comments
 (0)