commit d9490a4340366818f91fac428981fe662d552ca6 (tree)
parent 34835bbbcfe81cc87e823d14dc9b25e698ad5edc
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date: Sat, 1 Oct 2022 03:51:36 -0400
Sema: avoid undefined fields in file struct decls
Fixes original comment of #12399
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/Module.zig b/src/Module.zig
@@ -4430,6 +4430,8 @@ pub fn semaFile(mod: *Module, file: *File) SemaError!void {
new_decl.has_linksection_or_addrspace = false;
new_decl.ty = ty_ty;
new_decl.val = struct_val;
+ new_decl.@"align" = 0;
+ new_decl.@"linksection" = null;
new_decl.has_tv = true;
new_decl.owns_tv = true;
new_decl.alive = true; // This Decl corresponds to a File and is therefore always alive.