aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBarinzaya <barinzaya@gmail.com>2025-05-24 11:31:37 -0400
committerBarinzaya <barinzaya@gmail.com>2025-05-24 11:31:37 -0400
commitd402b7408ddc29ddd3e7fb260e43375df11c65e8 (patch)
tree707d00b153dfe53eeb515f8fbb93b9d926c31100 /core
parent142dd58b279b6d7291d75a1f8158fe315b7104c0 (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')
-rw-r--r--core/math/big/radix.odin2
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]