Skip to content

Commit

Permalink
mutex protect comp.arena in --verbose-link
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Oct 23, 2024
1 parent 2530d63 commit 5e11790
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/link/Elf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5e11790

Please sign in to comment.