From ee063e708a119012653bf22db5111537d2d53cb6 Mon Sep 17 00:00:00 2001 From: connnnal <216976529+connnnal@users.noreply.github.com> Date: Thu, 9 Oct 2025 11:38:22 +0100 Subject: [PATCH] Disable bounds check for the first utf8 byte Known safe from prior `n < 1` check --- core/unicode/utf8/utf8.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/unicode/utf8/utf8.odin b/core/unicode/utf8/utf8.odin index 67f8a8be9..91ec44886 100644 --- a/core/unicode/utf8/utf8.odin +++ b/core/unicode/utf8/utf8.odin @@ -108,7 +108,7 @@ decode_rune_in_bytes :: proc "contextless" (s: []u8) -> (rune, int) { if n < 1 { return RUNE_ERROR, 0 } - s0 := s[0] + #no_bounds_check s0 := s[0] x := accept_sizes[s0] if x >= 0xF0 { mask := rune(x) << 31 >> 31 // NOTE(bill): Create 0x0000 or 0xffff.