[php-src] master: Slightly clarify zend_wrong_parameter_error() implementation

From: Date: Fri, 30 Apr 2021 08:42:37 +0000
Subject: [php-src] master: Slightly clarify zend_wrong_parameter_error() implementation
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-115974@lists.php.net to get a copy of this message
Author: Nikita Popov (nikic) Date: 2021-04-30T10:38:34+02:00 Commit: https://github.com/php/php-src/commit/b9040852b34ba3faf102e3bc6954aea4d041f917 Raw diff: https://github.com/php/php-src/commit/b9040852b34ba3faf102e3bc6954aea4d041f917.diff 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. Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 9ea54084ceae..7b797e5a939c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -242,8 +242,10 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, case ZPP_ERROR_UNEXPECTED_EXTRA_NAMED: zend_unexpected_extra_named_error(); break; - default: - ZEND_ASSERT(error_code != ZPP_ERROR_OK); + case ZPP_ERROR_FAILURE: + ZEND_ASSERT(EG(exception) && "Should have produced an error already"); + break; + EMPTY_SWITCH_DEFAULT_CASE() } } /* }}} */

« previous php.cvs (#115974) next »