diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-27 12:53:55 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-27 12:54:48 +0100 |
commit | 1949a26aaca692840a6f272b45bf1cc155ee4c73 (patch) | |
tree | bfdb3d0dba745e208ac3d73e17db56f2f5bdc8f2 /Zend/zend_opcode.c | |
parent | 3ae04b05f5ca192205c2052b1dc8b8927aba1ff5 (diff) | |
download | php-git-1949a26aaca692840a6f272b45bf1cc155ee4c73.tar.gz |
Remove more null arithmetic UB
Introduce an EX_NUM_TO_VAR macro to mirror EX_VAR_TO_NUM and
replace usages of the ZEND_CALL_VAR_NUM(NULL) pattern.
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 881626b71e..4ebe92fa95 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -1035,15 +1035,15 @@ ZEND_API int pass_two(zend_op_array *op_array) if (opline->op1_type == IS_CONST) { ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1); } else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { - opline->op1.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op1.var); + opline->op1.var = EX_NUM_TO_VAR(op_array->last_var + opline->op1.var); } if (opline->op2_type == IS_CONST) { ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2); } else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) { - opline->op2.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op2.var); + opline->op2.var = EX_NUM_TO_VAR(op_array->last_var + opline->op2.var); } if (opline->result_type & (IS_VAR|IS_TMP_VAR)) { - opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->result.var); + opline->result.var = EX_NUM_TO_VAR(op_array->last_var + opline->result.var); } ZEND_VM_SET_OPCODE_HANDLER(opline); opline++; |