commit ada72c7aa91600f6bbc7d45f6efe09d6104dc93a (tree)
parent c64b885c829e38ed6033290cda916f6c9ffdab81
Author: Matthew Borkowski <matthew.h.borkowski@gmail.com>
Date: Sat, 2 Oct 2021 08:10:17 -0400
astgen.zig: assert that advanceSourceCursor never has to rewind cursor
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/AstGen.zig b/src/AstGen.zig
@@ -10566,6 +10566,7 @@ fn advanceSourceCursor(astgen: *AstGen, source: []const u8, end: usize) void {
var i = astgen.source_offset;
var line = astgen.source_line;
var column = astgen.source_column;
+ assert(i <= end);
while (i < end) : (i += 1) {
if (source[i] == '\n') {
line += 1;