| author | |
| committer | |
| log | 23295f64ca8b93f32e75cef42cc1293ec334e890 |
| tree | edb46c61f32219966c1796f4008ba41ac3fabeae |
| parent | 974a6fe757fd53873e7dace177ad3ae3c425b504 |
3 files changed, 9 insertions(+), 3 deletions(-)
src/AstGen.zig+2-2| ... | ... | @@ -10382,7 +10382,7 @@ fn appendErrorTok( |
| 10382 | 10382 | comptime format: []const u8, |
| 10383 | 10383 | args: anytype, |
| 10384 | 10384 | ) !void { |
| 10385 | try astgen.appendErrorTokNotes(token, format, args, &[0]u32{}); | |
| 10385 | try astgen.appendErrorTokNotesOff(token, 0, format, args, &[0]u32{}); | |
| 10386 | 10386 | } |
| 10387 | 10387 | |
| 10388 | 10388 | fn failTokNotes( |
| ... | ... | @@ -10392,7 +10392,7 @@ fn failTokNotes( |
| 10392 | 10392 | args: anytype, |
| 10393 | 10393 | notes: []const u32, |
| 10394 | 10394 | ) InnerError { |
| 10395 | try appendErrorTokNotes(astgen, token, format, args, notes); | |
| 10395 | try appendErrorTokNotesOff(astgen, token, 0, format, args, notes); | |
| 10396 | 10396 | return error.AnalysisFail; |
| 10397 | 10397 | } |
| 10398 | 10398 |
src/Compilation.zig+1-1| ... | ... | @@ -2909,7 +2909,7 @@ pub fn addZirErrorMessages(eb: *ErrorBundle.Wip, file: *Module.File) !void { |
| 2909 | 2909 | .column = @intCast(u32, err_loc.column), |
| 2910 | 2910 | .source_line = try eb.addString(err_loc.source_line), |
| 2911 | 2911 | }), |
| 2912 | .notes_len = item.data.notes, | |
| 2912 | .notes_len = item.data.notesLen(file.zir), | |
| 2913 | 2913 | }); |
| 2914 | 2914 | } |
| 2915 | 2915 |
src/Zir.zig+6| ... | ... | @@ -3594,6 +3594,12 @@ pub const Inst = struct { |
| 3594 | 3594 | /// 0 or a payload index of a `Block`, each is a payload |
| 3595 | 3595 | /// index of another `Item`. |
| 3596 | 3596 | notes: u32, |
| 3597 | ||
| 3598 | pub fn notesLen(item: Item, zir: Zir) u32 { | |
| 3599 | if (item.notes == 0) return 0; | |
| 3600 | const block = zir.extraData(Block, item.notes); | |
| 3601 | return block.data.body_len; | |
| 3602 | } | |
| 3597 | 3603 | }; |
| 3598 | 3604 | }; |
| 3599 | 3605 |