mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Avoid unnecessary string refcounting in ext/pcre (#17893)
This commit is contained in:
@@ -1563,9 +1563,12 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach
|
|||||||
fci->params = &arg;
|
fci->params = &arg;
|
||||||
zend_call_function(fci, fcc);
|
zend_call_function(fci, fcc);
|
||||||
zval_ptr_dtor(&arg);
|
zval_ptr_dtor(&arg);
|
||||||
|
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
|
||||||
|
return Z_STR(retval);
|
||||||
|
}
|
||||||
/* No Exception has occurred */
|
/* No Exception has occurred */
|
||||||
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
else if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
||||||
result_str = zval_try_get_string(&retval);
|
result_str = zval_try_get_string_func(&retval);
|
||||||
}
|
}
|
||||||
zval_ptr_dtor(&retval);
|
zval_ptr_dtor(&retval);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user