diff --git a/src/aro/Source.zig b/src/aro/Source.zig index 06e58ecb..af72e6d8 100644 --- a/src/aro/Source.zig +++ b/src/aro/Source.zig @@ -75,6 +75,10 @@ pub fn lineCol(source: Source, loc: Location) LineCol { i += 1; continue; }; + const slice = source.buf[i..]; + if (len > slice.len) { + break; + } const cp = std.unicode.utf8Decode(source.buf[i..][0..len]) catch { i += 1; continue;