diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-11-22 17:38:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 17:38:52 +0100 |
commit | 8faa3059951a38bc9e6065470892d01a92fa785b (patch) | |
tree | 39537641aa77efc0202d60fd270a592d4b660070 /vm.c | |
parent | 5fd5e8c3d785da27b90320f6ac93853ecf87eeae (diff) | |
parent | fdc9b6a3841d7346dab6f4aeea06322be0d3ee95 (diff) |
Merge pull request #123 from jow-/fix-logical-assignment-operators
compiler: fix `??=`, `||=` and `&&=` logical assignment sementics
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -1409,31 +1409,6 @@ uc_vm_value_bitop(uc_vm_t *vm, uc_vm_insn_t operation, uc_value_t *value, uc_val } static uc_value_t * -uc_vm_value_logical(uc_vm_t *vm, uc_vm_insn_t operation, uc_value_t *value, uc_value_t *operand) -{ - uc_value_t *rv = NULL; - - switch (operation) { - case I_LTRUE: - rv = ucv_get(ucv_is_truish(value) ? operand : value); - break; - - case I_LFALSE: - rv = ucv_get(ucv_is_truish(value) ? value : operand); - break; - - case I_LNULL: - rv = ucv_get(value == NULL ? operand : value); - break; - - default: - break; - } - - return rv; -} - -static uc_value_t * uc_vm_string_concat(uc_vm_t *vm, uc_value_t *v1, uc_value_t *v2) { char buf[sizeof(void *)], *s1, *s2; @@ -1492,9 +1467,6 @@ uc_vm_value_arith(uc_vm_t *vm, uc_vm_insn_t operation, uc_value_t *value, uc_val operation == I_BAND || operation == I_BXOR || operation == I_BOR) return uc_vm_value_bitop(vm, operation, value, operand); - if (operation == I_LTRUE || operation == I_LFALSE || operation == I_LNULL) - return uc_vm_value_logical(vm, operation, value, operand); - if (operation == I_ADD && (ucv_type(value) == UC_STRING || ucv_type(operand) == UC_STRING)) return uc_vm_string_concat(vm, value, operand); |