diff options
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r-- | Zend/zend_operators.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 24f1100650..70de104975 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1153,6 +1153,9 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2) /* {{{ */ return SUCCESS; } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval % op2_lval); return SUCCESS; } @@ -1315,6 +1318,9 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */ op2_lval = Z_LVAL_P(op2); } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval | op2_lval); return SUCCESS; } @@ -1370,6 +1376,9 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ */ op2_lval = Z_LVAL_P(op2); } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval & op2_lval); return SUCCESS; } @@ -1425,6 +1434,9 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */ op2_lval = Z_LVAL_P(op2); } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval ^ op2_lval); return SUCCESS; } @@ -1477,6 +1489,9 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */ } } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval << op2_lval); return SUCCESS; } @@ -1529,6 +1544,9 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ */ } } + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, op1_lval >> op2_lval); return SUCCESS; } |