diff options
| author | Barinzaya <barinzaya@gmail.com> | 2025-05-24 11:31:37 -0400 |
|---|---|---|
| committer | Barinzaya <barinzaya@gmail.com> | 2025-05-24 11:31:37 -0400 |
| commit | d402b7408ddc29ddd3e7fb260e43375df11c65e8 (patch) | |
| tree | 707d00b153dfe53eeb515f8fbb93b9d926c31100 /core/math | |
| parent | 142dd58b279b6d7291d75a1f8158fe315b7104c0 (diff) | |
Fix a range check in int_atoi in core:math/big.
The check seems to have been assuming that rune comparisons are
unsigned, but they're signed. This was causing an assertion failure for
certain input characters (anything with an ASCII value less than
'+'/43).
Diffstat (limited to 'core/math')
| -rw-r--r-- | core/math/big/radix.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/big/radix.odin b/core/math/big/radix.odin index a5100e478..a1c25b55e 100644 --- a/core/math/big/radix.odin +++ b/core/math/big/radix.odin @@ -280,7 +280,7 @@ int_atoi :: proc(res: ^Int, input: string, radix := i8(10), allocator := context } pos := ch - '+' - if RADIX_TABLE_REVERSE_SIZE <= pos { + if RADIX_TABLE_REVERSE_SIZE <= u32(pos) { break } y := RADIX_TABLE_REVERSE[pos] |