Skip to content

Commit

Permalink
Tracing JIT: Fixed possible memory-leak or missed destructor call.
Browse files Browse the repository at this point in the history
Reference-counter of return_value may be indirectly decremented to 1.
  • Loading branch information
dstogov committed Sep 28, 2021
1 parent 97b5eee commit c30298b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/opcache/jit/zend_jit_trace.c
Expand Up @@ -1786,6 +1786,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
return_value_info.type &= ~MAY_BE_UNDEF;
return_value_info.type |= MAY_BE_NULL;
}
if (return_value_info.type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
/* CVs are going to be destructed and the reference-counter
of return value may be decremented to 1 */
return_value_info.type |= MAY_BE_RC1;
}
return_value_info.type &= ~MAY_BE_GUARD;
}
break;
Expand Down

0 comments on commit c30298b

Please sign in to comment.