mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
Fix incdec of ref object properties
This fixes a number of infinite loops in the Symfony testsuite. It took an obscene amount of time to track this down :/
This commit is contained in:
parent
40256e0f9c
commit
ec7b5e0b19
@ -2086,6 +2086,7 @@ static void increment_string(zval *str) /* {{{ */
|
||||
|
||||
ZEND_API int increment_function(zval *op1) /* {{{ */
|
||||
{
|
||||
try_again:
|
||||
switch (Z_TYPE_P(op1)) {
|
||||
case IS_LONG:
|
||||
if (Z_LVAL_P(op1) == LONG_MAX) {
|
||||
@ -2141,6 +2142,9 @@ ZEND_API int increment_function(zval *op1) /* {{{ */
|
||||
return res;
|
||||
}
|
||||
return FAILURE;
|
||||
case IS_REFERENCE:
|
||||
op1 = Z_REFVAL_P(op1);
|
||||
goto try_again;
|
||||
default:
|
||||
return FAILURE;
|
||||
}
|
||||
@ -2153,6 +2157,7 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */
|
||||
long lval;
|
||||
double dval;
|
||||
|
||||
try_again:
|
||||
switch (Z_TYPE_P(op1)) {
|
||||
case IS_LONG:
|
||||
if (Z_LVAL_P(op1) == LONG_MIN) {
|
||||
@ -2200,6 +2205,9 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */
|
||||
return res;
|
||||
}
|
||||
return FAILURE;
|
||||
case IS_REFERENCE:
|
||||
op1 = Z_REFVAL_P(op1);
|
||||
goto try_again;
|
||||
default:
|
||||
return FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user