Skip to content

Commit ee9948b

Browse files
committed
Eliminate unnecessary exception checks
1 parent 0444158 commit ee9948b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,6 +4631,18 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze
46314631
return 1;
46324632
}
46334633
return 0;
4634+
case ZEND_FETCH_DIM_W:
4635+
case ZEND_FETCH_LIST_W:
4636+
if ((t1 & (MAY_BE_ANY|MAY_BE_REF)) != MAY_BE_ARRAY) {
4637+
return 1;
4638+
}
4639+
if (t2 & (MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT)) {
4640+
return 1;
4641+
}
4642+
if (opline->op2_type == IS_UNUSED) {
4643+
return 1;
4644+
}
4645+
return 0;
46344646
default:
46354647
return 1;
46364648
}

0 commit comments

Comments
 (0)