diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index da00b09af17..a53ac0aefea 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -4982,9 +4982,16 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par res_use_info = zend_jit_trace_type_to_info( STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))) & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE); + res_addr = RES_REG_ADDR(); + if (Z_MODE(res_addr) != IS_REG && + STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)) != + STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))) { + /* type may be not set */ + res_use_info |= MAY_BE_NULL; + } if (!zend_jit_qm_assign(&dasm_state, opline, op1_info, op1_addr, op1_def_addr, - res_use_info, res_info, RES_REG_ADDR())) { + res_use_info, res_info, res_addr)) { goto jit_failure; } if (opline->op1_type == IS_CV diff --git a/ext/opcache/tests/jit/qm_assign_003.phpt b/ext/opcache/tests/jit/qm_assign_003.phpt new file mode 100644 index 00000000000..1c57a9bea22 --- /dev/null +++ b/ext/opcache/tests/jit/qm_assign_003.phpt @@ -0,0 +1,26 @@ +--TEST-- +JIT QM_ASSIGN: 003 missing type store +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + +DONE +--EXPECT-- +DONE \ No newline at end of file