From ee9948bc46f2db44791231d8af8307d073f732f1 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 9 Sep 2020 16:15:37 +0300 Subject: [PATCH] Eliminate unnecessary exception checks --- ext/opcache/Optimizer/zend_inference.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 13e8f5d094..ed18c85e2b 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -4631,6 +4631,18 @@ int zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const ze return 1; } return 0; + case ZEND_FETCH_DIM_W: + case ZEND_FETCH_LIST_W: + if ((t1 & (MAY_BE_ANY|MAY_BE_REF)) != MAY_BE_ARRAY) { + return 1; + } + if (t2 & (MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT)) { + return 1; + } + if (opline->op2_type == IS_UNUSED) { + return 1; + } + return 0; default: return 1; } -- 2.40.0