diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index fcf38a1dab8c8..cd9fcde9dcc75 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -148,6 +148,15 @@ PHP_MINFO_FUNCTION(bcmath) } /* }}} */ +static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num) +{ + if (UNEXPECTED(scale < 0 || scale > INT_MAX)) { + zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX); + return FAILURE; + } + return SUCCESS; +} + static void php_long2num(bc_num *num, zend_long lval) { *num = bc_long2num(lval); @@ -1305,15 +1314,6 @@ static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err( return SUCCESS; } -static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num) -{ - if (UNEXPECTED(scale < 0 || scale > INT_MAX)) { - zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX); - return FAILURE; - } - return SUCCESS; -} - PHP_METHOD(BcMath_Number, __construct) { zend_string *str = NULL;