Skip to content

Commit 497f687

Browse files
committed
Tweak zend_may_throw for -- with null values
1 parent d513efc commit 497f687

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4687,9 +4687,11 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
46874687
return (t1 & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
46884688
case ZEND_PRE_INC:
46894689
case ZEND_POST_INC:
4690+
return (t1 & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
4691+
/* null emits a warning as it has no effect compared to ++ which converts the value to 1 */
46904692
case ZEND_PRE_DEC:
46914693
case ZEND_POST_DEC:
4692-
return (t1 & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
4694+
return (t1 & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
46934695
case ZEND_BOOL_NOT:
46944696
case ZEND_JMPZ:
46954697
case ZEND_JMPNZ:

0 commit comments

Comments
 (0)