commit d565f8bef2b606649e805586cf305ea0da9a8fb2 (tree)
parent 75f4420c2db46cc3d9fe9c75ac035c588bbcf4bf
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Sat, 30 Sep 2023 19:22:55 +0200
elf: check for null atom in ZigModule
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
@@ -1320,7 +1320,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node
if (self.zig_module_index) |index| {
const zig_module = self.file(index).?.zig_module;
for (zig_module.atoms.items) |atom_index| {
- const atom_ptr = self.atom(atom_index).?;
+ const atom_ptr = self.atom(atom_index) orelse continue;
if (!atom_ptr.flags.alive) continue;
const shdr = &self.shdrs.items[atom_ptr.outputShndx().?];
if (shdr.sh_type == elf.SHT_NOBITS) continue;