| ... | ... | @@ -433,7 +433,9 @@ pub const Wip = struct { |
| 433 | 433 | // The ensureUnusedCapacity call above guarantees this. |
| 434 | 434 | const notes_start = wip.reserveNotes(@intCast(other_list.len)) catch unreachable; |
| 435 | 435 | for (notes_start.., other_list) |note, message| { |
| 436 | | wip.extra.items[note] = @intFromEnum(wip.addOtherMessage(other, message) catch unreachable); |
| 436 | // This line can cause `wip.extra.items` to be resized. |
| 437 | const note_index = @intFromEnum(wip.addOtherMessage(other, message) catch unreachable); |
| 438 | wip.extra.items[note] = note_index; |
| 437 | 439 | } |
| 438 | 440 | } |
| 439 | 441 | |
| ... | ... | @@ -522,7 +524,8 @@ pub const Wip = struct { |
| 522 | 524 | }; |
| 523 | 525 | const loc = std.zig.findLineColumn(source, span.main); |
| 524 | 526 | |
| 525 | | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ |
| 527 | // This line can cause `wip.extra.items` to be resized. |
| 528 | const note_index = @intFromEnum(try eb.addErrorMessage(.{ |
| 526 | 529 | .msg = try eb.addString(msg), |
| 527 | 530 | .src_loc = try eb.addSourceLocation(.{ |
| 528 | 531 | .src_path = try eb.addString(src_path), |
| ... | ... | @@ -538,6 +541,7 @@ pub const Wip = struct { |
| 538 | 541 | }), |
| 539 | 542 | .notes_len = 0, // TODO rework this function to be recursive |
| 540 | 543 | })); |
| 544 | eb.extra.items[note_i] = note_index; |
| 541 | 545 | } |
| 542 | 546 | } |
| 543 | 547 | } |