mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Avoid unnecessary string refcounting in ext/pcre (#17893)
This commit is contained in:
parent
1eacd4aea0
commit
03f97fc34b
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue