Skip to content

Commit b904085

Browse files
committed
Slightly clarify zend_wrong_parameter_error() implementation
This function may be called with Z_ERROR_FAILURE, and should do nothing in that case. Otherwise, all cases need to be explicitly handled.
1 parent feab479 commit b904085

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Zend/zend_API.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
242242
case ZPP_ERROR_UNEXPECTED_EXTRA_NAMED:
243243
zend_unexpected_extra_named_error();
244244
break;
245-
default:
246-
ZEND_ASSERT(error_code != ZPP_ERROR_OK);
245+
case ZPP_ERROR_FAILURE:
246+
ZEND_ASSERT(EG(exception) && "Should have produced an error already");
247+
break;
248+
EMPTY_SWITCH_DEFAULT_CASE()
247249
}
248250
}
249251
/* }}} */

0 commit comments

Comments
 (0)