From: Nikita Popov Date: Mon, 12 Oct 2020 09:25:27 +0000 (+0200) Subject: Merge branch 'PHP-7.4' into PHP-8.0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66ecee624318d1e06c5f94b0bbeac20a65d5c7aa;p=php Merge branch 'PHP-7.4' into PHP-8.0 * PHP-7.4: Detect self-addition of array more accurately Deindirect source elements in zend_hash_merge --- 66ecee624318d1e06c5f94b0bbeac20a65d5c7aa diff --cc Zend/zend_operators.c index e7fb82e04f,596581270b..d1f2d553fc --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@@ -938,19 -932,9 +938,19 @@@ ZEND_API zend_string* ZEND_FASTCALL zva } /* }}} */ +static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const char *operator, zval *op1, zval *op2) /* {{{ */ { + if (EG(exception)) { + return; + } + + zend_type_error("Unsupported operand types: %s %s %s", + zend_zval_type_name(op1), operator, zend_zval_type_name(op2)); +} +/* }}} */ + static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */ { - if ((result == op1) && (result == op2)) { + if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) { /* $a += $a */ return; }