@@ -17742,8 +17742,15 @@ static void jit_frameless_icall2(zend_jit_ctx *jit, const zend_op *opline, uint3
17742
17742
17743
17743
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
17744
17744
/* Set OP1 to UNDEF in case FREE_OP2() throws. */
17745
- if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) != 0 && (opline->op2_type & (IS_VAR|IS_TMP_VAR)) != 0) {
17745
+ if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) != 0
17746
+ && (opline->op2_type & (IS_VAR|IS_TMP_VAR)) != 0
17747
+ && (op2_info & MAY_BE_RC1)
17748
+ && (op2_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY))) {
17746
17749
jit_set_Z_TYPE_INFO(jit, op1_addr, IS_UNDEF);
17750
+ if (JIT_G(current_frame)) {
17751
+ SET_STACK_TYPE(JIT_G(current_frame)->stack,
17752
+ EX_VAR_TO_NUM(opline->op1.var), IS_UNKNOWN, 1);
17753
+ }
17747
17754
}
17748
17755
jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL);
17749
17756
zend_jit_check_exception(jit);
@@ -17816,18 +17823,34 @@ static void jit_frameless_icall3(zend_jit_ctx *jit, const zend_op *opline, uint3
17816
17823
17817
17824
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
17818
17825
/* Set OP1 to UNDEF in case FREE_OP2() throws. */
17826
+ bool op1_undef = false;
17819
17827
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))
17820
- && ((opline->op2_type & (IS_VAR|IS_TMP_VAR))
17821
- || (op_data_type & (IS_VAR|IS_TMP_VAR)))) {
17828
+ && (((opline->op2_type & (IS_VAR|IS_TMP_VAR))
17829
+ && (op2_info & MAY_BE_RC1)
17830
+ && (op2_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY)))
17831
+ || ((op_data_type & (IS_VAR|IS_TMP_VAR))
17832
+ && (op1_data_info & MAY_BE_RC1)
17833
+ && (op1_data_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY))))) {
17834
+ op1_undef = true;
17822
17835
jit_set_Z_TYPE_INFO(jit, op1_addr, IS_UNDEF);
17836
+ if (JIT_G(current_frame)) {
17837
+ SET_STACK_TYPE(JIT_G(current_frame)->stack,
17838
+ EX_VAR_TO_NUM(opline->op1.var), IS_UNKNOWN, 1);
17839
+ }
17823
17840
}
17824
17841
jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL);
17825
- /* If OP1 is a TMP|VAR , we don't need to set OP2 to UNDEF on free because
17842
+ /* If OP1 is set to UNDEF , we don't need to set OP2 to UNDEF on free because
17826
17843
* zend_fetch_debug_backtrace aborts when it encounters the first UNDEF TMP|VAR. */
17827
- if (!(opline->op1_type & (IS_VAR|IS_TMP_VAR))
17844
+ if (!op1_undef
17828
17845
&& (opline->op2_type & (IS_VAR|IS_TMP_VAR)) != 0
17829
- && (op_data_type & (IS_VAR|IS_TMP_VAR)) != 0) {
17846
+ && (op_data_type & (IS_VAR|IS_TMP_VAR)) != 0
17847
+ && (op1_data_info & MAY_BE_RC1)
17848
+ && (op1_data_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY))) {
17830
17849
jit_set_Z_TYPE_INFO(jit, op2_addr, IS_UNDEF);
17850
+ if (JIT_G(current_frame)) {
17851
+ SET_STACK_TYPE(JIT_G(current_frame)->stack,
17852
+ EX_VAR_TO_NUM(opline->op2.var), IS_UNKNOWN, 1);
17853
+ }
17831
17854
}
17832
17855
jit_FREE_OP(jit, (opline+1)->op1_type, (opline+1)->op1, op1_data_info, NULL);
17833
17856
zend_jit_check_exception(jit);
0 commit comments