mirror of
https://github.com/php/php-src.git
synced 2026-04-05 07:02:33 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1:
JIT: Fixed memory leak in Zend/tests/concat_002.phpt introduced by fac78ee760
This commit is contained in:
@@ -1162,10 +1162,13 @@ static void ZEND_FASTCALL zend_jit_fast_assign_concat_helper(zval *op1, zval *op
|
||||
|
||||
do {
|
||||
if (Z_REFCOUNTED_P(op1)) {
|
||||
if (GC_REFCOUNT(Z_STR_P(op1)) == 1 && EXPECTED(Z_STR_P(op1) != Z_STR_P(op2))) {
|
||||
if (GC_REFCOUNT(Z_STR_P(op1)) == 1) {
|
||||
result_str = perealloc(Z_STR_P(op1), ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(result_len)), 0);
|
||||
ZSTR_LEN(result_str) = result_len;
|
||||
zend_string_forget_hash_val(result_str);
|
||||
if (UNEXPECTED(Z_STR_P(op1) == Z_STR_P(op2))) {
|
||||
ZVAL_NEW_STR(op2, result_str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
GC_DELREF(Z_STR_P(op1));
|
||||
|
||||
Reference in New Issue
Block a user