@@ -4893,6 +4893,21 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
4893
4893
zend_may_throw_ex (opline , ssa_op , op_array , ssa , op1_info , op2_info ))) {
4894
4894
goto jit_failure ;
4895
4895
}
4896
+ if (ssa_op -> op2_def > 0
4897
+ && Z_MODE (op2_addr ) == IS_REG
4898
+ && ssa -> vars [ssa_op -> op2_def ].no_val ) {
4899
+ uint8_t type = (op2_info & MAY_BE_LONG ) ? IS_LONG : IS_DOUBLE ;
4900
+ uint32_t var_num = EX_VAR_TO_NUM (opline -> op2 .var );
4901
+
4902
+ if (STACK_MEM_TYPE (stack , var_num ) != type
4903
+ && ssa -> vars [ssa_op -> op2_def ].use_chain < 0
4904
+ && !ssa -> vars [ssa_op -> op2_def ].phi_use_chain ) {
4905
+ if (!zend_jit_store_type (& ctx , var_num , type )) {
4906
+ return 0 ;
4907
+ }
4908
+ SET_STACK_TYPE (stack , var_num , type , 1 );
4909
+ }
4910
+ }
4896
4911
if (opline -> op2_type == IS_CV
4897
4912
&& ssa_op -> op2_def >= 0
4898
4913
&& ssa -> vars [ssa_op -> op2_def ].alias == NO_ALIAS ) {
@@ -4931,6 +4946,21 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
4931
4946
res_use_info , res_info , res_addr )) {
4932
4947
goto jit_failure ;
4933
4948
}
4949
+ if (ssa_op -> op1_def > 0
4950
+ && Z_MODE (op1_addr ) == IS_REG
4951
+ && ssa -> vars [ssa_op -> op1_def ].no_val ) {
4952
+ uint8_t type = (op1_info & MAY_BE_LONG ) ? IS_LONG : IS_DOUBLE ;
4953
+ uint32_t var_num = EX_VAR_TO_NUM (opline -> op1 .var );
4954
+
4955
+ if (STACK_MEM_TYPE (stack , var_num ) != type
4956
+ && ssa -> vars [ssa_op -> op1_def ].use_chain < 0
4957
+ && !ssa -> vars [ssa_op -> op1_def ].phi_use_chain ) {
4958
+ if (!zend_jit_store_type (& ctx , var_num , type )) {
4959
+ return 0 ;
4960
+ }
4961
+ SET_STACK_TYPE (stack , var_num , type , 1 );
4962
+ }
4963
+ }
4934
4964
if (opline -> op1_type == IS_CV
4935
4965
&& ssa_op -> op1_def >= 0
4936
4966
&& ssa -> vars [ssa_op -> op1_def ].alias == NO_ALIAS ) {
@@ -5013,6 +5043,21 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5013
5043
op1_info , op1_addr , op1_def_addr )) {
5014
5044
goto jit_failure ;
5015
5045
}
5046
+ if (ssa_op -> op1_def > 0
5047
+ && Z_MODE (op1_addr ) == IS_REG
5048
+ && ssa -> vars [ssa_op -> op1_def ].no_val ) {
5049
+ uint8_t type = (op1_info & MAY_BE_LONG ) ? IS_LONG : IS_DOUBLE ;
5050
+ uint32_t var_num = EX_VAR_TO_NUM (opline -> op1 .var );
5051
+
5052
+ if (STACK_MEM_TYPE (stack , var_num ) != type
5053
+ && ssa -> vars [ssa_op -> op1_def ].use_chain < 0
5054
+ && !ssa -> vars [ssa_op -> op1_def ].phi_use_chain ) {
5055
+ if (!zend_jit_store_type (& ctx , var_num , type )) {
5056
+ return 0 ;
5057
+ }
5058
+ SET_STACK_TYPE (stack , var_num , type , 1 );
5059
+ }
5060
+ }
5016
5061
if (opline -> op1_type == IS_CV
5017
5062
&& ssa_op -> op1_def >= 0
5018
5063
&& ssa -> vars [ssa_op -> op1_def ].alias == NO_ALIAS ) {
0 commit comments