authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-09-30 19:22:55+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-16 19:33:04+02:00
logd565f8bef2b606649e805586cf305ea0da9a8fb2
tree288eae9a53a4e886b074f40d5ed35d83a4734993
parent75f4420c2db46cc3d9fe9c75ac035c588bbcf4bf

elf: check for null atom in ZigModule


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

src/link/Elf.zig+1-1
...@@ -1320,7 +1320,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node...@@ -1320,7 +1320,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node
1320 if (self.zig_module_index) |index| {1320 if (self.zig_module_index) |index| {
1321 const zig_module = self.file(index).?.zig_module;1321 const zig_module = self.file(index).?.zig_module;
1322 for (zig_module.atoms.items) |atom_index| {1322 for (zig_module.atoms.items) |atom_index| {
1323 const atom_ptr = self.atom(atom_index).?;1323 const atom_ptr = self.atom(atom_index) orelse continue;
1324 if (!atom_ptr.flags.alive) continue;1324 if (!atom_ptr.flags.alive) continue;
1325 const shdr = &self.shdrs.items[atom_ptr.outputShndx().?];1325 const shdr = &self.shdrs.items[atom_ptr.outputShndx().?];
1326 if (shdr.sh_type == elf.SHT_NOBITS) continue;1326 if (shdr.sh_type == elf.SHT_NOBITS) continue;