Skip to content

Commit 2096a61

Browse files
committed
SEND may throw for named params
1 parent aa6b25c commit 2096a61

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,13 +4382,8 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
43824382
case ZEND_JMP:
43834383
case ZEND_CHECK_VAR:
43844384
case ZEND_MAKE_REF:
4385-
case ZEND_SEND_VAR:
43864385
case ZEND_BEGIN_SILENCE:
43874386
case ZEND_END_SILENCE:
4388-
case ZEND_SEND_VAL:
4389-
case ZEND_SEND_REF:
4390-
case ZEND_SEND_VAR_EX:
4391-
case ZEND_SEND_FUNC_ARG:
43924387
case ZEND_FREE:
43934388
case ZEND_SEPARATE:
43944389
case ZEND_TYPE_CHECK:
@@ -4403,10 +4398,17 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
44034398
case ZEND_FUNC_NUM_ARGS:
44044399
case ZEND_FUNC_GET_ARGS:
44054400
case ZEND_COPY_TMP:
4406-
case ZEND_CHECK_FUNC_ARG:
44074401
case ZEND_CASE_STRICT:
44084402
case ZEND_JMP_NULL:
44094403
return 0;
4404+
case ZEND_SEND_VAR:
4405+
case ZEND_SEND_VAL:
4406+
case ZEND_SEND_REF:
4407+
case ZEND_SEND_VAR_EX:
4408+
case ZEND_SEND_FUNC_ARG:
4409+
case ZEND_CHECK_FUNC_ARG:
4410+
/* May throw for named params. */
4411+
return opline->op2_type == IS_CONST;
44104412
case ZEND_INIT_FCALL:
44114413
/* can't throw, because call is resolved at compile time */
44124414
return 0;

0 commit comments

Comments
 (0)