summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2d41f3fda6..02c79fbafc 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5637,9 +5637,11 @@ static inline zend_bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode
binary_op_type fn = get_binary_op(opcode);
/* don't evaluate division by zero at compile-time */
- if (opcode == ZEND_MOD && zval_get_long(op2) == 0) {
+ if ((opcode == ZEND_DIV || opcode == ZEND_MOD) &&
+ zval_get_long(op2) == 0) {
return 0;
- } else if ((opcode == ZEND_SL || opcode == ZEND_SR) && zval_get_long(op2) < 0) {
+ } else if ((opcode == ZEND_SL || opcode == ZEND_SR) &&
+ zval_get_long(op2) < 0) {
return 0;
}