@@ -1305,9 +1305,9 @@ static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err(
1305
1305
return SUCCESS ;
1306
1306
}
1307
1307
1308
- static zend_always_inline zend_result bcmath_check_scale (zend_long scale , bool scale_is_null , uint32_t arg_num )
1308
+ static zend_always_inline zend_result bcmath_check_scale (zend_long scale , uint32_t arg_num )
1309
1309
{
1310
- if (UNEXPECTED (! scale_is_null && ( scale < 0 || scale > INT_MAX ) )) {
1310
+ if (UNEXPECTED (scale < 0 || scale > INT_MAX )) {
1311
1311
zend_argument_value_error (arg_num , "must be between 0 and %d" , INT_MAX );
1312
1312
return FAILURE ;
1313
1313
}
@@ -1359,7 +1359,7 @@ static void bcmath_number_calc_method(INTERNAL_FUNCTION_PARAMETERS, uint8_t opco
1359
1359
if (bc_num_from_obj_or_str_or_long_with_err (& num , & num_full_scale , num_obj , num_str , num_lval , 1 ) == FAILURE ) {
1360
1360
goto fail ;
1361
1361
}
1362
- if (bcmath_check_scale (scale_lval , scale_is_null , 2 ) == FAILURE ) {
1362
+ if (bcmath_check_scale (scale_lval , 2 ) == FAILURE ) {
1363
1363
goto fail ;
1364
1364
}
1365
1365
@@ -1469,7 +1469,7 @@ PHP_METHOD(BcMath_Number, powmod)
1469
1469
if (bc_num_from_obj_or_str_or_long_with_err (& modulus_num , NULL , modulus_obj , modulus_str , modulus_lval , 2 ) == FAILURE ) {
1470
1470
goto cleanup ;
1471
1471
}
1472
- if (bcmath_check_scale (scale_lval , scale_is_null , 3 ) == FAILURE ) {
1472
+ if (bcmath_check_scale (scale_lval , 3 ) == FAILURE ) {
1473
1473
goto cleanup ;
1474
1474
}
1475
1475
@@ -1530,7 +1530,7 @@ PHP_METHOD(BcMath_Number, sqrt)
1530
1530
Z_PARAM_LONG_OR_NULL (scale_lval , scale_is_null );
1531
1531
ZEND_PARSE_PARAMETERS_END ();
1532
1532
1533
- if (bcmath_check_scale (scale_lval , scale_is_null , 1 ) == FAILURE ) {
1533
+ if (bcmath_check_scale (scale_lval , 1 ) == FAILURE ) {
1534
1534
RETURN_THROWS ();
1535
1535
}
1536
1536
@@ -1584,7 +1584,7 @@ PHP_METHOD(BcMath_Number, compare)
1584
1584
if (bc_num_from_obj_or_str_or_long_with_err (& num , & num_full_scale , num_obj , num_str , num_lval , 1 ) == FAILURE ) {
1585
1585
goto fail ;
1586
1586
}
1587
- if (bcmath_check_scale (scale_lval , scale_is_null , 2 ) == FAILURE ) {
1587
+ if (bcmath_check_scale (scale_lval , 2 ) == FAILURE ) {
1588
1588
goto fail ;
1589
1589
}
1590
1590
0 commit comments