From d402b7408ddc29ddd3e7fb260e43375df11c65e8 Mon Sep 17 00:00:00 2001 From: Barinzaya Date: Sat, 24 May 2025 11:31:37 -0400 Subject: [PATCH] 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). --- core/math/big/radix.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]