msvcrt: Treat large exponent as overflow in strtod.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0945ba00fb
commit
ee65859b7f
|
@ -423,7 +423,7 @@ static double make_double(int sign, int exp, ULONGLONG m, enum round round, int
|
|||
}
|
||||
}
|
||||
|
||||
if (exp >= 1<<EXP_BITS)
|
||||
if (exp >= (1<<EXP_BITS)-1)
|
||||
{
|
||||
if (err) *err = MSVCRT_ERANGE;
|
||||
return sign * INFINITY;
|
||||
|
|
|
@ -1956,7 +1956,12 @@ static void test__strtod(void)
|
|||
{ "0.1d238", 7, 0.1e238 },
|
||||
{ "0.1D-4736", 9, 0, ERANGE },
|
||||
{ "3.4028234663852887e38", 21, FLT_MAX },
|
||||
{ "1.1754943508222875e-38", 22, FLT_MIN },
|
||||
{ "1.7976931348623158e+308", 23, DBL_MAX },
|
||||
{ "1.7976931348623159e+308", 23, INFINITY, ERANGE },
|
||||
{ "2.2250738585072014e-308", 23, DBL_MIN },
|
||||
{ "-1.7976931348623158e+308", 24, -DBL_MAX },
|
||||
{ "-1.7976931348623159e+308", 24, -INFINITY, ERANGE },
|
||||
{ "00", 2, 0 },
|
||||
{ "00.", 3, 0 },
|
||||
{ ".00", 3, 0 },
|
||||
|
|
Loading…
Reference in New Issue