Skip to content

Commit 44c7e7c

Browse files
Girgiasiluuu1994
andauthored
Improve optimizer inference for when it may throw
Co-authored-by: Ilija Tovilo <[email protected]>
1 parent 0c4746e commit 44c7e7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4836,7 +4836,8 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
48364836
return 0;
48374837
}
48384838
case ZEND_FETCH_IS:
4839-
return (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_STRING));
4839+
return (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT))
4840+
|| (t1 & MAY_BE_STRING && t2 & MAY_BE_STRING);
48404841
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
48414842
return (t1 & MAY_BE_OBJECT) || (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT));
48424843
case ZEND_FETCH_DIM_IS:

0 commit comments

Comments
 (0)