Skip to content

Commit bcadbec

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Tracing JIT: Fixed possible memory-leak or missed destructor call.
2 parents 4df3281 + bae21b5 commit bcadbec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
19281928
return_value_info.type &= ~MAY_BE_UNDEF;
19291929
return_value_info.type |= MAY_BE_NULL;
19301930
}
1931+
if (return_value_info.type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
1932+
/* CVs are going to be destructed and the reference-counter
1933+
of return value may be decremented to 1 */
1934+
return_value_info.type |= MAY_BE_RC1;
1935+
}
19311936
return_value_info.type &= ~MAY_BE_GUARD;
19321937
}
19331938
break;

0 commit comments

Comments
 (0)