FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix multiple uses of variable 'L' in _Py_dg_strtod, where one use req… · python-emscripten/cpython@18a818b · GitHub

Repository navigation

Commit 18a818b

Browse files
committed
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.
1 parent 811ff82 commit 18a818b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎Python/dtoa.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,8 @@ _Py_dg_strtod(const char *s00, char **se)
13451345
const char *s, *s0, *s1;
13461346
double aadj, aadj1;
13471347
U aadj2, adj, rv, rv0;
1348-
ULong y, z, L;
1348+
ULong y, z, abse;
1349+
Long L;
13491350
BCinfo bc;
13501351
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
13511352

@@ -1425,17 +1426,17 @@ _Py_dg_strtod(const char *s00, char **se)
14251426
while(c == '0')
14261427
c = *++s;
14271428
if (c > '0' && c <= '9') {
1428-
L = c - '0';
1429+
abse = c - '0';
14291430
s1 = s;
14301431
while((c = *++s) >= '0' && c <= '9')
1431-
L = 10*L + c - '0';
1432-
if (s - s1 > 8 || L > MAX_ABS_EXP)
1432+
abse = 10*abse + c - '0';
1433+
if (s - s1 > 8 || abse > MAX_ABS_EXP)
14331434
/* Avoid confusion from exponents
14341435
* so large that e might overflow.
14351436
*/
14361437
e = (int)MAX_ABS_EXP; /* safe for 16 bit ints */
14371438
else
1438-
e = (int)L;
1439+
e = (int)abse;
14391440
if (esign)
14401441
e = -e;
14411442
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL