@@ -4935,14 +4935,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
4935
4935
}
4936
4936
op2_addr = OP2_REG_ADDR ();
4937
4937
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 )) {
4945
4940
op2_def_addr = op2_addr ;
4941
+ } else {
4942
+ op2_def_addr = OP2_DEF_REG_ADDR ();
4946
4943
}
4947
4944
CHECK_OP2_TRACE_TYPE ();
4948
4945
op1_info = OP1_INFO ();
@@ -5038,12 +5035,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5038
5035
ZEND_FALLTHROUGH ;
5039
5036
case ZEND_QM_ASSIGN :
5040
5037
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 )) {
5046
5039
op1_def_addr = op1_addr ;
5040
+ } else {
5041
+ op1_def_addr = OP1_DEF_REG_ADDR ();
5047
5042
}
5048
5043
op1_info = OP1_INFO ();
5049
5044
CHECK_OP1_TRACE_TYPE ();
@@ -5134,12 +5129,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5134
5129
break ;
5135
5130
}
5136
5131
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 )) {
5142
5133
op1_def_addr = op1_addr ;
5134
+ } else {
5135
+ op1_def_addr = OP1_DEF_REG_ADDR ();
5143
5136
}
5144
5137
op1_info = OP1_INFO ();
5145
5138
CHECK_OP1_TRACE_TYPE ();
@@ -6353,7 +6346,14 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
6353
6346
SET_STACK_TYPE (stack , EX_VAR_TO_NUM (opline -> op1 .var ), type ,
6354
6347
(gen_handler || type == IS_UNKNOWN || !ra ||
6355
6348
(!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 )))));
6357
6357
if (type != IS_UNKNOWN ) {
6358
6358
ssa -> var_info [ssa_op -> op1_def ].type &= ~MAY_BE_GUARD ;
6359
6359
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
6399
6399
}
6400
6400
SET_STACK_TYPE (stack , EX_VAR_TO_NUM (opline -> op2 .var ), type ,
6401
6401
(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 ))));
6403
6406
if (type != IS_UNKNOWN ) {
6404
6407
ssa -> var_info [ssa_op -> op2_def ].type &= ~MAY_BE_GUARD ;
6405
6408
if (ra && ra [ssa_op -> op2_def ]) {
0 commit comments