summaryrefslogtreecommitdiffhomepage
path: root/vm.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-08 12:58:09 +0200
committerJo-Philipp Wich <jo@mein.io>2021-06-08 13:54:50 +0200
commitce6081dbbd588fb111754f3c2c1c93d2421c6ee6 (patch)
tree30d469066e6053128cc60dbae0b6160131d4518a /vm.c
parenta363e9c5e848ad21908b66d59433ab07dffbc7f1 (diff)
lexer, vm: reorder token and instruction numbers
Ensure that relational operators in the lexer token and vm instruction lists are both ordered in the same way according to the general operator precedence of the grammar. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 8a503a0..1dfeba4 100644
--- a/vm.c
+++ b/vm.c
@@ -1230,7 +1230,8 @@ uc_vm_value_arith(uc_vm *vm, enum insn_type operation, uc_value_t *value, uc_val
int64_t n1, n2;
double d1, d2;
- if (operation > I_MOD)
+ if (operation == I_LSHIFT || operation == I_RSHIFT ||
+ operation == I_BAND || operation == I_BXOR || operation == I_BOR)
return uc_vm_value_bitop(vm, operation, value, operand);
if (operation == I_ADD && (ucv_type(value) == UC_STRING || ucv_type(operand) == UC_STRING)) {