Skip to content

Commit 923c682

Browse files
committed
don't reject alternative digit characters
1 parent 077eed1 commit 923c682

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinConstructors.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,19 +1281,9 @@ private static BigInteger asciiToBigInteger(String str, int possibleBase) throws
12811281
}
12821282
} else {
12831283
acceptUnderscore = true;
1284-
if (base <= 10) {
1285-
if (c < '0' || c > ('0' - 1 + base)) {
1286-
// invalid char
1287-
return null;
1288-
}
1289-
} else {
1290-
if (c < '0' || c > '9') {
1291-
// not in 0-9, check for a-z/A-Z
1292-
if ((c < 'a' || c > ('a' - 11 + base)) && (c < 'A' || c > ('A' - 11 + base))) {
1293-
// invalid char
1294-
return null;
1295-
}
1296-
}
1284+
if (Character.digit(c, base) == -1) {
1285+
// invalid char
1286+
return null;
12971287
}
12981288
}
12991289
}

0 commit comments

Comments
 (0)