]> granicus.if.org Git - php/commitdiff
Change type of max_num_args to uint32_t
authortwosee <twose@qq.com>
Wed, 22 Jul 2020 14:29:30 +0000 (22:29 +0800)
committertwosee <twose@qq.com>
Wed, 22 Jul 2020 16:55:58 +0000 (00:55 +0800)
Closes GH-5885.

Zend/zend_API.h

index 0eb4bffa39a132c9ce6579d9c689473c06915691..b9eecd3e2654ef8f9e258f4f170d27b19d9806ba 100644 (file)
@@ -1256,7 +1256,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
 #define ZEND_PARSE_PARAMETERS_START_EX(flags, min_num_args, max_num_args) do { \
                const int _flags = (flags); \
                uint32_t _min_num_args = (min_num_args); \
-               int _max_num_args = (max_num_args);  /* TODO uint32_t */ \
+               uint32_t _max_num_args = (uint32_t) (max_num_args); \
                uint32_t _num_args = EX_NUM_ARGS(); \
                uint32_t _i = 0; \
                zval *_real_arg, *_arg = NULL; \
@@ -1274,8 +1274,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
                \
                do { \
                        if (UNEXPECTED(_num_args < _min_num_args) || \
-                           (UNEXPECTED(_num_args > _max_num_args) && \
-                            EXPECTED(_max_num_args >= 0))) { \
+                           UNEXPECTED(_num_args > _max_num_args)) { \
                                if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
                                        zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \
                                } \