mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
Disable bounds check for the first utf8 byte
Known safe from prior `n < 1` check
This commit is contained in:
@@ -108,7 +108,7 @@ decode_rune_in_bytes :: proc "contextless" (s: []u8) -> (rune, int) {
|
|||||||
if n < 1 {
|
if n < 1 {
|
||||||
return RUNE_ERROR, 0
|
return RUNE_ERROR, 0
|
||||||
}
|
}
|
||||||
s0 := s[0]
|
#no_bounds_check s0 := s[0]
|
||||||
x := accept_sizes[s0]
|
x := accept_sizes[s0]
|
||||||
if x >= 0xF0 {
|
if x >= 0xF0 {
|
||||||
mask := rune(x) << 31 >> 31 // NOTE(bill): Create 0x0000 or 0xffff.
|
mask := rune(x) << 31 >> 31 // NOTE(bill): Create 0x0000 or 0xffff.
|
||||||
|
|||||||
Reference in New Issue
Block a user