aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2022-10-01 03:51:36 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2022-10-01 04:02:00 -0400
commitd9490a4340366818f91fac428981fe662d552ca6 (patch)
tree930bb6fee4ccf3a74cc4eb61cfb179562313b080 /src
parent34835bbbcfe81cc87e823d14dc9b25e698ad5edc (diff)
downloadzig-d9490a4340366818f91fac428981fe662d552ca6.tar.gz
zig-d9490a4340366818f91fac428981fe662d552ca6.zip
Sema: avoid undefined fields in file struct decls
Fixes original comment of #12399
Diffstat (limited to 'src')
-rw-r--r--src/Module.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 6056c385e3..37e693c275 100644
--- 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.