diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index ebe1af530f4..5d291d21f6e 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -1928,6 +1928,11 @@ propagate_arg: 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;