Fix multiple uses of variable 'L' in _Py_dg_strtod, where one use requires an unsigned long and the other a signed long. See also r77421.

This commit is contained in:
Mark Dickinson 2010-01-16 18:06:17 +00:00
parent 811ff822f8
commit 18a818bc63

View file

@ -1345,7 +1345,8 @@ _Py_dg_strtod(const char *s00, char **se)
const char *s, *s0, *s1; const char *s, *s0, *s1;
double aadj, aadj1; double aadj, aadj1;
U aadj2, adj, rv, rv0; U aadj2, adj, rv, rv0;
ULong y, z, L; ULong y, z, abse;
Long L;
BCinfo bc; BCinfo bc;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
@ -1425,17 +1426,17 @@ _Py_dg_strtod(const char *s00, char **se)
while(c == '0') while(c == '0')
c = *++s; c = *++s;
if (c > '0' && c <= '9') { if (c > '0' && c <= '9') {
L = c - '0'; abse = c - '0';
s1 = s; s1 = s;
while((c = *++s) >= '0' && c <= '9') while((c = *++s) >= '0' && c <= '9')
L = 10*L + c - '0'; abse = 10*abse + c - '0';
if (s - s1 > 8 || L > MAX_ABS_EXP) if (s - s1 > 8 || abse > MAX_ABS_EXP)
/* Avoid confusion from exponents /* Avoid confusion from exponents
* so large that e might overflow. * so large that e might overflow.
*/ */
e = (int)MAX_ABS_EXP; /* safe for 16 bit ints */ e = (int)MAX_ABS_EXP; /* safe for 16 bit ints */
else else
e = (int)L; e = (int)abse;
if (esign) if (esign)
e = -e; e = -e;
} }