aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 17:52:58 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 17:52:58 +0000
commit081661cb6b0c2932a1e7e1d16860942fa7f9f195 (patch)
tree4914bbfaf10fa6d751563258a4450e5e1f5c979f
parent90d901345abcbb271653fbee6749a2b3273fb62e (diff)
downloadovm-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.
-rw-r--r--vm/runtime.c2
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)