Skip to content

Commit 17fac12

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fixed ext/bz2/tests/005.phpt test failure introduesed by 09547c6
2 parents 217fd93 + 4eaba3e commit 17fac12

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Zend/zend_execute.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,9 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
16021602
} else {
16031603
s = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
16041604
ZSTR_H(s) = ZSTR_H(Z_STR_P(str));
1605+
if (Z_REFCOUNTED_P(str)) {
1606+
zend_string_release_ex(Z_STR_P(str), 0);
1607+
}
16051608
ZVAL_NEW_STR(str, s);
16061609
}
16071610

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,9 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
947947
} else {
948948
s = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
949949
ZSTR_H(s) = ZSTR_H(Z_STR_P(str));
950+
if (Z_REFCOUNTED_P(str)) {
951+
zend_string_release_ex(Z_STR_P(str), 0);
952+
}
950953
ZVAL_NEW_STR(str, s);
951954
}
952955

0 commit comments

Comments
 (0)