1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix throw in IS_IDENTICAL in JIT (#15103)

We need to persist opline in case zend_is_identical() throws.
This commit is contained in:
Ilija Tovilo
2024-07-25 13:18:47 +02:00
committed by GitHub
parent da72ac11f6
commit a0a8624346
2 changed files with 8 additions and 3 deletions

View File

@@ -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:

View File

@@ -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),