1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-24 23:40:27 +00:00

Address issues from #1294 on non-nanboxed platforms.

Underlying bug was obscured by nanbox implementation.
This commit is contained in:
Calvin Rose 2023-09-21 07:36:53 -07:00
parent 910b9cf1fd
commit 7b4c3bdbcc

View File

@ -861,7 +861,7 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
vm_pcnext(); vm_pcnext();
VM_OP(JOP_EQUALS_IMMEDIATE) VM_OP(JOP_EQUALS_IMMEDIATE)
stack[A] = janet_wrap_boolean(janet_unwrap_number(stack[B]) == (double) CS); stack[A] = janet_wrap_boolean(janet_checktype(stack[B], JANET_NUMBER) && (janet_unwrap_number(stack[B]) == (double) CS));
vm_pcnext(); vm_pcnext();
VM_OP(JOP_NOT_EQUALS) VM_OP(JOP_NOT_EQUALS)
@ -869,7 +869,7 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
vm_pcnext(); vm_pcnext();
VM_OP(JOP_NOT_EQUALS_IMMEDIATE) VM_OP(JOP_NOT_EQUALS_IMMEDIATE)
stack[A] = janet_wrap_boolean(janet_unwrap_number(stack[B]) != (double) CS); stack[A] = janet_wrap_boolean(!janet_checktype(stack[B], JANET_NUMBER) || (janet_unwrap_number(stack[B]) != (double) CS));
vm_pcnext(); vm_pcnext();
VM_OP(JOP_COMPARE) VM_OP(JOP_COMPARE)