authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-23 10:06:52-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-23 10:44:46-07:00
log2beb21c4e4a59190c998e07596e323d5ace68a21
tree6614a9bcf9968b15adf71636cc623ab24dcdef71
parent960932a4bf4f470e7a3f32b2d56035fc4b530ba8

stage2: fix crash when using stage1 backend

Calling processOutdatedAndDeletedDecls() should not happen when using the stage1 backend. Problem solved with checking a simple flag.

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

src/Compilation.zig+7-3
......@@ -1952,9 +1952,13 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
19521952 }
19531953 }
19541954
1955 // Iterate over all the files and look for outdated and deleted declarations.
1956 if (self.bin_file.options.module) |mod| {
1957 try mod.processOutdatedAndDeletedDecls();
1955 const use_stage1 = build_options.omit_stage2 or
1956 (build_options.is_stage1 and self.bin_file.options.use_llvm);
1957 if (!use_stage1) {
1958 // Iterate over all the files and look for outdated and deleted declarations.
1959 if (self.bin_file.options.module) |mod| {
1960 try mod.processOutdatedAndDeletedDecls();
1961 }
19581962 }
19591963
19601964 while (self.work_queue.readItem()) |work_item| switch (work_item) {