Skip to content

Commit c30298b

Browse files
committed
Tracing JIT: Fixed possible memory-leak or missed destructor call.
Reference-counter of return_value may be indirectly decremented to 1.
1 parent 97b5eee commit c30298b

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
@@ -1786,6 +1786,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17861786
return_value_info.type &= ~MAY_BE_UNDEF;
17871787
return_value_info.type |= MAY_BE_NULL;
17881788
}
1789+
if (return_value_info.type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
1790+
/* CVs are going to be destructed and the reference-counter
1791+
of return value may be decremented to 1 */
1792+
return_value_info.type |= MAY_BE_RC1;
1793+
}
17891794
return_value_info.type &= ~MAY_BE_GUARD;
17901795
}
17911796
break;

0 commit comments

Comments
 (0)