Skip to content

Commit df16da3

Browse files
committed
Fixed ext/bz2/tests/005.phpt test failure introduesed by 09547c6
1 parent 999c6f2 commit df16da3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Zend/zend_execute.c

+3
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,9 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
15391539
} else {
15401540
s = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
15411541
ZSTR_H(s) = ZSTR_H(Z_STR_P(str));
1542+
if (Z_REFCOUNTED_P(str)) {
1543+
zend_string_release_ex(Z_STR_P(str), 0);
1544+
}
15421545
ZVAL_NEW_STR(str, s);
15431546
}
15441547

ext/opcache/jit/zend_jit_helpers.c

+3
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,9 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
11361136
} else {
11371137
s = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
11381138
ZSTR_H(s) = ZSTR_H(Z_STR_P(str));
1139+
if (Z_REFCOUNTED_P(str)) {
1140+
zend_string_release_ex(Z_STR_P(str), 0);
1141+
}
11391142
ZVAL_NEW_STR(str, s);
11401143
}
11411144

0 commit comments

Comments
 (0)