From 081661cb6b0c2932a1e7e1d16860942fa7f9f195 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 1 Nov 2023 17:52:58 +0000 Subject: Fixed bug with comparators where all results were flipped This is because: say we have {a, b} where a is on top of the stack. A comparator C applies in the order C(b, a) i.e. b `C` a. The previous version did a `C` b which was wrong. --- vm/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/runtime.c b/vm/runtime.c index 3279354..fd26024 100644 --- a/vm/runtime.c +++ b/vm/runtime.c @@ -655,7 +655,7 @@ VM_NOT_TYPE(word, WORD) err = vm_pop_##TYPEL(vm, &b); \ if (err) \ return err; \ - return vm_push_byte(vm, DBYTE(a.as_##GETL COMP b.as_##GETL)); \ + return vm_push_byte(vm, DBYTE(b.as_##GETL COMP a.as_##GETL)); \ } VM_BITWISE_TYPE(or, |, byte, BYTE) -- cgit v1.2.3-13-gbd6f