mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 17:35:12 +00:00
previously when T was smaller than 8 bits, it was possible for base to overflow T (because base is a u8). this patch prevents this by accumulating into a U rather than T which is at least 8 bits wide. this is the best way i could think of to maintain performance. this will only affect parsing of integers less than 8 bits by adding one additional cast at return. additionally, this patch may be slightly slower to return an error for integers less than 8 bits which overflow because it will accumulate a few more digits before the overflow check at return. * add tests which previously overflowed when they shouldn't have closes #18157