mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
stage2: avoid calling freeDecl when hasCodeGenBits == false
Previously the frontend incorrectly called freeDecl for structs, which never got allocateDecl called for them. There was simply a missing check for hasCodeGenBits().
This commit is contained in:
parent
d839835273
commit
3697022a41
@ -3499,9 +3499,11 @@ pub fn deleteDecl(
|
||||
}
|
||||
_ = mod.compile_log_decls.swapRemove(decl);
|
||||
mod.deleteDeclExports(decl);
|
||||
mod.comp.bin_file.freeDecl(decl);
|
||||
|
||||
if (decl.has_tv) {
|
||||
if (decl.ty.hasCodeGenBits()) {
|
||||
mod.comp.bin_file.freeDecl(decl);
|
||||
}
|
||||
if (decl.getInnerNamespace()) |namespace| {
|
||||
try namespace.deleteAllDecls(mod, outdated_decls);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user