diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 17:52:58 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 17:52:58 +0000 |
commit | 081661cb6b0c2932a1e7e1d16860942fa7f9f195 (patch) | |
tree | 4914bbfaf10fa6d751563258a4450e5e1f5c979f /vm/runtime.c | |
parent | 90d901345abcbb271653fbee6749a2b3273fb62e (diff) | |
download | ovm-081661cb6b0c2932a1e7e1d16860942fa7f9f195.tar.gz ovm-081661cb6b0c2932a1e7e1d16860942fa7f9f195.tar.bz2 ovm-081661cb6b0c2932a1e7e1d16860942fa7f9f195.zip |
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.
Diffstat (limited to 'vm/runtime.c')
-rw-r--r-- | vm/runtime.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |