authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-29 20:49:31-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-29 20:49:31-07:00
log5d696b0706de2ac267cb774ef39e0d81131d5c38
tree0e7a903e54510035ba0a437a0343bc0f1330cbc2
parent8ab4a003c8f22a3fd8f84bdb2fc27d8c20d3bf2f

stage2: fix File incorrectly freeing its Namespace


1 files changed, 1 insertions(+), 1 deletions(-)

src/Module.zig+1-1
...@@ -776,6 +776,7 @@ pub const Scope = struct {...@@ -776,6 +776,7 @@ pub const Scope = struct {
776 pkg: *Package,776 pkg: *Package,
777 /// The namespace of the struct that represents this file.777 /// The namespace of the struct that represents this file.
778 /// Populated only when status is success.778 /// Populated only when status is success.
779 /// Owned by its owner Decl Value.
779 namespace: *Namespace,780 namespace: *Namespace,
780 /// All namespaces that this file contains. This is here so that781 /// All namespaces that this file contains. This is here so that
781 /// when a file is updated, and new ZIR code is generated, the782 /// when a file is updated, and new ZIR code is generated, the
...@@ -812,7 +813,6 @@ pub const Scope = struct {...@@ -812,7 +813,6 @@ pub const Scope = struct {
812813
813 pub fn deinit(file: *File, mod: *Module) void {814 pub fn deinit(file: *File, mod: *Module) void {
814 const gpa = mod.gpa;815 const gpa = mod.gpa;
815 file.namespace.deinit(mod);
816 gpa.free(file.sub_file_path);816 gpa.free(file.sub_file_path);
817 file.unload(gpa);817 file.unload(gpa);
818 file.* = undefined;818 file.* = undefined;