@@ -4935,14 +4935,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
49354935 }
49364936 op2_addr = OP2_REG_ADDR ();
49374937 op2_info = OP2_INFO ();
4938- if (ra
4939- && ssa_op -> op2_def >= 0
4940- && (!ssa -> vars [ssa_op -> op2_def ].no_val
4941- || (zend_jit_trace_type_to_info (STACK_MEM_TYPE (stack , EX_VAR_TO_NUM (opline -> op2 .var ))) & MAY_BE_ANY ) !=
4942- (op2_info & MAY_BE_ANY ))) {
4943- op2_def_addr = OP2_DEF_REG_ADDR ();
4944- } else {
4938+
4939+ if (ssa_op -> op2_def < 0 || (Z_MODE (op2_addr ) == IS_REG && ssa -> vars [ssa_op -> op2_def ].no_val )) {
49454940 op2_def_addr = op2_addr ;
4941+ } else {
4942+ op2_def_addr = OP2_DEF_REG_ADDR ();
49464943 }
49474944 CHECK_OP2_TRACE_TYPE ();
49484945 op1_info = OP1_INFO ();
@@ -5038,12 +5035,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
50385035 ZEND_FALLTHROUGH ;
50395036 case ZEND_QM_ASSIGN :
50405037 op1_addr = OP1_REG_ADDR ();
5041- if (ra
5042- && ssa_op -> op1_def >= 0
5043- && !ssa -> vars [ssa_op -> op1_def ].no_val ) {
5044- op1_def_addr = OP1_DEF_REG_ADDR ();
5045- } else {
5038+ if (ssa_op -> op1_def < 0 || (Z_MODE (op1_addr ) == IS_REG && ssa -> vars [ssa_op -> op1_def ].no_val )) {
50465039 op1_def_addr = op1_addr ;
5040+ } else {
5041+ op1_def_addr = OP1_DEF_REG_ADDR ();
50475042 }
50485043 op1_info = OP1_INFO ();
50495044 CHECK_OP1_TRACE_TYPE ();
@@ -5134,12 +5129,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
51345129 break ;
51355130 }
51365131 op1_addr = OP1_REG_ADDR ();
5137- if (ra
5138- && ssa_op -> op1_def >= 0
5139- && !ssa -> vars [ssa_op -> op1_def ].no_val ) {
5140- op1_def_addr = OP1_DEF_REG_ADDR ();
5141- } else {
5132+ if (ssa_op -> op1_def < 0 || (Z_MODE (op1_addr ) == IS_REG && ssa -> vars [ssa_op -> op1_def ].no_val )) {
51425133 op1_def_addr = op1_addr ;
5134+ } else {
5135+ op1_def_addr = OP1_DEF_REG_ADDR ();
51435136 }
51445137 op1_info = OP1_INFO ();
51455138 CHECK_OP1_TRACE_TYPE ();
@@ -6353,7 +6346,14 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
63536346 SET_STACK_TYPE (stack , EX_VAR_TO_NUM (opline -> op1 .var ), type ,
63546347 (gen_handler || type == IS_UNKNOWN || !ra ||
63556348 (!ra [ssa_op -> op1_def ] &&
6356- (opline -> opcode == ZEND_ASSIGN || !ssa -> vars [ssa_op -> op1_def ].no_val ))));
6349+ !(ssa -> vars [ssa_op -> op1_def ].no_val &&
6350+ Z_MODE (OP1_REG_ADDR ()) == IS_REG &&
6351+ (opline -> opcode == ZEND_QM_ASSIGN ||
6352+ opline -> opcode == ZEND_SEND_VAR ||
6353+ opline -> opcode == ZEND_SEND_VAR_EX ||
6354+ opline -> opcode == ZEND_SEND_VAR_NO_REF ||
6355+ opline -> opcode == ZEND_SEND_VAR_NO_REF_EX ||
6356+ opline -> opcode == ZEND_SEND_FUNC_ARG )))));
63576357 if (type != IS_UNKNOWN ) {
63586358 ssa -> var_info [ssa_op -> op1_def ].type &= ~MAY_BE_GUARD ;
63596359 if (ra && ra [ssa_op -> op1_def ]) {
@@ -6399,7 +6399,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
63996399 }
64006400 SET_STACK_TYPE (stack , EX_VAR_TO_NUM (opline -> op2 .var ), type ,
64016401 (gen_handler || type == IS_UNKNOWN || !ra ||
6402- (!ra [ssa_op -> op2_def ] && !ssa -> vars [ssa_op -> op2_def ].no_val )));
6402+ (!ra [ssa_op -> op2_def ] &&
6403+ !(ssa -> vars [ssa_op -> op2_def ].no_val &&
6404+ Z_MODE (OP2_REG_ADDR ()) == IS_REG &&
6405+ opline -> opcode == ZEND_ASSIGN ))));
64036406 if (type != IS_UNKNOWN ) {
64046407 ssa -> var_info [ssa_op -> op2_def ].type &= ~MAY_BE_GUARD ;
64056408 if (ra && ra [ssa_op -> op2_def ]) {
0 commit comments