diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 4f3de5d3f8517..b7fa1e837d096 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -4998,8 +4998,6 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op switch (opline->opcode) { case ZEND_NOP: - case ZEND_IS_IDENTICAL: - case ZEND_IS_NOT_IDENTICAL: case ZEND_QM_ASSIGN: case ZEND_JMP: case ZEND_CHECK_VAR: @@ -5021,10 +5019,14 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op case ZEND_FUNC_NUM_ARGS: case ZEND_FUNC_GET_ARGS: case ZEND_COPY_TMP: - case ZEND_CASE_STRICT: case ZEND_JMP_NULL: case ZEND_JMP_FRAMELESS: return 0; + case ZEND_IS_IDENTICAL: + case ZEND_IS_NOT_IDENTICAL: + case ZEND_CASE_STRICT: + /* Array to array comparison may lead to recursion. */ + return (t1 & t2) & MAY_BE_ARRAY_OF_ARRAY; case ZEND_SEND_VAR: case ZEND_SEND_VAL: case ZEND_SEND_REF: diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 80099291d886d..966b22a081150 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -7335,6 +7335,9 @@ static int zend_jit_identical(zend_jit_ctx *jit, } op2_addr = real_addr; } + if (may_throw) { + jit_SET_EX_OPLINE(jit, opline); + } ref = ir_CALL_2(IR_BOOL, ir_CONST_FC_FUNC(zend_is_identical), jit_ZVAL_ADDR(jit, op1_addr),