Skip to content

Commit f89933d

Browse files
committed
SEND may throw for named params
1 parent ffdd990 commit f89933d

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
@@ -4354,13 +4354,8 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
43544354
case ZEND_JMP:
43554355
case ZEND_CHECK_VAR:
43564356
case ZEND_MAKE_REF:
4357-
case ZEND_SEND_VAR:
43584357
case ZEND_BEGIN_SILENCE:
43594358
case ZEND_END_SILENCE:
4360-
case ZEND_SEND_VAL:
4361-
case ZEND_SEND_REF:
4362-
case ZEND_SEND_VAR_EX:
4363-
case ZEND_SEND_FUNC_ARG:
43644359
case ZEND_FREE:
43654360
case ZEND_SEPARATE:
43664361
case ZEND_TYPE_CHECK:
@@ -4375,10 +4370,17 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
43754370
case ZEND_FUNC_NUM_ARGS:
43764371
case ZEND_FUNC_GET_ARGS:
43774372
case ZEND_COPY_TMP:
4378-
case ZEND_CHECK_FUNC_ARG:
43794373
case ZEND_CASE_STRICT:
43804374
case ZEND_JMP_NULL:
43814375
return 0;
4376+
case ZEND_SEND_VAR:
4377+
case ZEND_SEND_VAL:
4378+
case ZEND_SEND_REF:
4379+
case ZEND_SEND_VAR_EX:
4380+
case ZEND_SEND_FUNC_ARG:
4381+
case ZEND_CHECK_FUNC_ARG:
4382+
/* May throw for named params. */
4383+
return opline->op2_type == IS_CONST;
43824384
case ZEND_INIT_FCALL:
43834385
/* can't throw, because call is resolved at compile time */
43844386
return 0;

0 commit comments

Comments
 (0)