aboutsummaryrefslogtreecommitdiff
path: root/src/link
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-12-17 16:36:44 -0500
committerJacob Young <jacobly0@users.noreply.github.com>2024-12-17 16:37:04 -0500
commit2bb05f0ee7d545af1de5269e9a0d3aac59eb3f12 (patch)
tree08e71a9eecf479706dc269d854048326b29337c1 /src/link
parentdebba652a3f5af76840517321d389a2ec98a88f4 (diff)
downloadzig-2bb05f0ee7d545af1de5269e9a0d3aac59eb3f12.tar.gz
zig-2bb05f0ee7d545af1de5269e9a0d3aac59eb3f12.zip
Dwarf: fix data races by reading from ZIR
Diffstat (limited to 'src/link')
-rw-r--r--src/link/Dwarf.zig25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig
index 4f336083ec..97192cdcd0 100644
--- a/src/link/Dwarf.zig
+++ b/src/link/Dwarf.zig
@@ -2277,12 +2277,10 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
=> DW.ACCESS.private,
_ => if (decl_extra.name.isNamedTest(file.zir))
DW.ACCESS.private
- else if (parent_namespace_ptr.pub_decls.containsContext(nav_index, .{ .zcu = zcu }))
+ else if (decl_extra.flags.is_pub)
DW.ACCESS.public
- else if (parent_namespace_ptr.priv_decls.containsContext(nav_index, .{ .zcu = zcu }))
- DW.ACCESS.private
else
- unreachable,
+ DW.ACCESS.private,
},
};
} else .{ zcu.fileRootType(inst_info.file), DW.ACCESS.private };
@@ -2326,12 +2324,10 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
=> DW.ACCESS.private,
_ => if (decl_extra.name.isNamedTest(file.zir))
DW.ACCESS.private
- else if (parent_namespace_ptr.pub_decls.containsContext(nav_index, .{ .zcu = zcu }))
+ else if (decl_extra.flags.is_pub)
DW.ACCESS.public
- else if (parent_namespace_ptr.priv_decls.containsContext(nav_index, .{ .zcu = zcu }))
- DW.ACCESS.private
else
- unreachable,
+ DW.ACCESS.private,
},
};
} else .{ zcu.fileRootType(inst_info.file), DW.ACCESS.private };
@@ -2373,12 +2369,10 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
=> DW.ACCESS.private,
_ => if (decl_extra.name.isNamedTest(file.zir))
DW.ACCESS.private
- else if (parent_namespace_ptr.pub_decls.containsContext(nav_index, .{ .zcu = zcu }))
+ else if (decl_extra.flags.is_pub)
DW.ACCESS.public
- else if (parent_namespace_ptr.priv_decls.containsContext(nav_index, .{ .zcu = zcu }))
- DW.ACCESS.private
else
- unreachable,
+ DW.ACCESS.private,
},
};
} else .{ zcu.fileRootType(inst_info.file), DW.ACCESS.private };
@@ -2624,12 +2618,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
const parent_namespace_ptr = ip.namespacePtr(ip.getCau(cau).namespace);
break :parent .{
parent_namespace_ptr.owner_type,
- if (parent_namespace_ptr.pub_decls.containsContext(nav_index, .{ .zcu = zcu }))
- DW.ACCESS.public
- else if (parent_namespace_ptr.priv_decls.containsContext(nav_index, .{ .zcu = zcu }))
- DW.ACCESS.private
- else
- unreachable,
+ if (decl_extra.data.flags.is_pub) DW.ACCESS.public else DW.ACCESS.private,
};
} else .{ zcu.fileRootType(inst_info.file), DW.ACCESS.private };