فهرست منبع

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).
Barinzaya 4 ماه پیش
والد
کامیت
d402b7408d
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      core/math/big/radix.odin

+ 1 - 1
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]