| ... | @@ -3867,6 +3867,9 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void { | ... | @@ -3867,6 +3867,9 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void { |
| 3867 | const gpa = mod.gpa; | 3867 | const gpa = mod.gpa; |
| 3868 | const new_zir = file.zir; | 3868 | const new_zir = file.zir; |
| 3869 | | 3869 | |
| | 3870 | // The root decl will be null if the previous ZIR had AST errors. |
| | 3871 | const root_decl = file.root_decl.unwrap() orelse return; |
| | 3872 | |
| 3870 | // Maps from old ZIR to new ZIR, struct_decl, enum_decl, etc. Any instruction which | 3873 | // Maps from old ZIR to new ZIR, struct_decl, enum_decl, etc. Any instruction which |
| 3871 | // creates a namespace, gets mapped from old to new here. | 3874 | // creates a namespace, gets mapped from old to new here. |
| 3872 | var inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index) = .{}; | 3875 | var inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index) = .{}; |
| ... | @@ -3884,7 +3887,6 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void { | ... | @@ -3884,7 +3887,6 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void { |
| 3884 | var decl_stack: ArrayListUnmanaged(Decl.Index) = .{}; | 3887 | var decl_stack: ArrayListUnmanaged(Decl.Index) = .{}; |
| 3885 | defer decl_stack.deinit(gpa); | 3888 | defer decl_stack.deinit(gpa); |
| 3886 | | 3889 | |
| 3887 | const root_decl = file.root_decl.unwrap().?; | | |
| 3888 | try decl_stack.append(gpa, root_decl); | 3890 | try decl_stack.append(gpa, root_decl); |
| 3889 | | 3891 | |
| 3890 | file.deleted_decls.clearRetainingCapacity(); | 3892 | file.deleted_decls.clearRetainingCapacity(); |