From af5f3d8dd09d9bbcde15a2ae4a6d48c070eb0ac2 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Thu, 9 Jan 2025 14:56:58 -0500 Subject: [PATCH] pio: Assembler: fix issue in diag when tokenizer has index on newline (#347) --- port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig b/port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig index 7df6ead8..85d229c4 100644 --- a/port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig +++ b/port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig @@ -99,7 +99,7 @@ fn format_compile_error(comptime message: []const u8, comptime source: []const u var line_it = std.mem.tokenize(u8, source, "\n\r"); while (line_it.next()) |line| : (line_num += 1) { line_str = line_str ++ "\n" ++ line; - if (line_it.index > index) { + if (line_it.index >= index) { column = line.len - (line_it.index - index); line_str = line; break;