Skip to content

Commit f364ab8

Browse files
committed
Fix overflow in power-of-10 calculation on 32bit systems where "long long" > "Py_ssize_t" (of decimal_len).
1 parent 255b6b1 commit f364ab8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quicktions.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ cdef tuple _parse_fraction(AnyString s, Py_ssize_t s_len):
16591659
if state in (SMALL_NUM, SMALL_DECIMAL, SMALL_DECIMAL_DOT, SMALL_END_SPACE):
16601660
# Special case for 'small' numbers: normalise directly in C space.
16611661
if inum and decimal_len:
1662-
idenom = 10 ** decimal_len
1662+
idenom = 10 ** <ullong> decimal_len
16631663
igcd = _igcd[ullong](inum, idenom)
16641664
if igcd > 1:
16651665
inum //= igcd

0 commit comments

Comments
 (0)