Skip to content

Commit bae21b5

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Tracing JIT: Fixed possible memory-leak or missed destructor call.
2 parents b5242fa + c30298b commit bae21b5

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
@@ -1930,6 +1930,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
19301930
return_value_info.type &= ~MAY_BE_UNDEF;
19311931
return_value_info.type |= MAY_BE_NULL;
19321932
}
1933+
if (return_value_info.type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
1934+
/* CVs are going to be destructed and the reference-counter
1935+
of return value may be decremented to 1 */
1936+
return_value_info.type |= MAY_BE_RC1;
1937+
}
19331938
return_value_info.type &= ~MAY_BE_GUARD;
19341939
}
19351940
break;

0 commit comments

Comments
 (0)