Commit 5e11790c7b

Andrew Kelley <andrew@ziglang.org>
2024-10-24 01:25:58
mutex protect comp.arena in --verbose-link
1 parent 2530d63
Changed files (1)
src
link
src/link/Elf.zig
@@ -775,6 +775,9 @@ pub fn loadInput(self: *Elf, input: link.Input) !void {
     const is_static_lib = self.base.isStaticLib();
 
     if (comp.verbose_link) {
+        comp.mutex.lock(); // protect comp.arena
+        defer comp.mutex.unlock();
+
         const argv = &self.dump_argv_list;
         switch (input) {
             .res => unreachable,