mirror of
https://github.com/janet-lang/janet
synced 2025-06-05 16:14:12 +00:00
Fix vm bugs from #1566
This commit is contained in:
parent
7c38a55a9a
commit
18c00e89da
@ -798,14 +798,14 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
|
|||||||
vm_pcnext();
|
vm_pcnext();
|
||||||
|
|
||||||
VM_OP(JOP_JUMP)
|
VM_OP(JOP_JUMP)
|
||||||
pc += DS;
|
|
||||||
vm_maybe_auto_suspend(DS <= 0);
|
vm_maybe_auto_suspend(DS <= 0);
|
||||||
|
pc += DS;
|
||||||
vm_next();
|
vm_next();
|
||||||
|
|
||||||
VM_OP(JOP_JUMP_IF)
|
VM_OP(JOP_JUMP_IF)
|
||||||
if (janet_truthy(stack[A])) {
|
if (janet_truthy(stack[A])) {
|
||||||
pc += ES;
|
|
||||||
vm_maybe_auto_suspend(ES <= 0);
|
vm_maybe_auto_suspend(ES <= 0);
|
||||||
|
pc += ES;
|
||||||
} else {
|
} else {
|
||||||
pc++;
|
pc++;
|
||||||
}
|
}
|
||||||
@ -815,15 +815,15 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
|
|||||||
if (janet_truthy(stack[A])) {
|
if (janet_truthy(stack[A])) {
|
||||||
pc++;
|
pc++;
|
||||||
} else {
|
} else {
|
||||||
pc += ES;
|
|
||||||
vm_maybe_auto_suspend(ES <= 0);
|
vm_maybe_auto_suspend(ES <= 0);
|
||||||
|
pc += ES;
|
||||||
}
|
}
|
||||||
vm_next();
|
vm_next();
|
||||||
|
|
||||||
VM_OP(JOP_JUMP_IF_NIL)
|
VM_OP(JOP_JUMP_IF_NIL)
|
||||||
if (janet_checktype(stack[A], JANET_NIL)) {
|
if (janet_checktype(stack[A], JANET_NIL)) {
|
||||||
pc += ES;
|
|
||||||
vm_maybe_auto_suspend(ES <= 0);
|
vm_maybe_auto_suspend(ES <= 0);
|
||||||
|
pc += ES;
|
||||||
} else {
|
} else {
|
||||||
pc++;
|
pc++;
|
||||||
}
|
}
|
||||||
@ -833,8 +833,8 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
|
|||||||
if (janet_checktype(stack[A], JANET_NIL)) {
|
if (janet_checktype(stack[A], JANET_NIL)) {
|
||||||
pc++;
|
pc++;
|
||||||
} else {
|
} else {
|
||||||
pc += ES;
|
|
||||||
vm_maybe_auto_suspend(ES <= 0);
|
vm_maybe_auto_suspend(ES <= 0);
|
||||||
|
pc += ES;
|
||||||
}
|
}
|
||||||
vm_next();
|
vm_next();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user