Skip to content

Commit 0df3171

Browse files
committed
Allow SCCP for increment on null
1 parent c110f63 commit 0df3171

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Zend/Optimizer/sccp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,7 @@ static inline zend_result ct_eval_incdec(zval *result, uint8_t opcode, zval *op1
669669
return FAILURE;
670670
}
671671
*/
672-
/* Decrement on null emits a deprecation notice */
673-
if (Z_TYPE_P(op1) != IS_LONG && Z_TYPE_P(op1) != IS_DOUBLE /* && Z_TYPE_P(op1) != IS_NULL */) {
672+
if (Z_TYPE_P(op1) != IS_LONG && Z_TYPE_P(op1) != IS_DOUBLE && Z_TYPE_P(op1) != IS_NULL) {
674673
return FAILURE;
675674
}
676675

@@ -681,6 +680,11 @@ static inline zend_result ct_eval_incdec(zval *result, uint8_t opcode, zval *op1
681680
|| opcode == ZEND_POST_INC_OBJ) {
682681
increment_function(result);
683682
} else {
683+
/* Decrement on null emits a deprecation notice */
684+
if (Z_TYPE_P(op1) == IS_NULL) {
685+
zval_ptr_dtor(result);
686+
return FAILURE;
687+
}
684688
decrement_function(result);
685689
}
686690
return SUCCESS;

0 commit comments

Comments
 (0)