aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-20 16:42:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-20 16:42:43 -0700
commit8b734380f9e900826b1a9cb9804887035f2fe085 (patch)
tree4dd1486fb75337de20dd3d54e2a481d13076e1cc /src/codegen/llvm.zig
parentc8ded2f9c940be2d59f5e9dc7d66374b67afba63 (diff)
downloadzig-8b734380f9e900826b1a9cb9804887035f2fe085.tar.gz
zig-8b734380f9e900826b1a9cb9804887035f2fe085.zip
stage2: LLVM backend: fix decls sometimes not marked alive
Without this they could get incorrectly garbage collected.
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 734a5de78e..e9dccb4009 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -1383,6 +1383,7 @@ pub const DeclGen = struct {
ptr_val: Value,
decl: *Module.Decl,
) Error!ParentPtr {
+ decl.alive = true;
var ptr_ty_payload: Type.Payload.ElemType = .{
.base = .{ .tag = .single_mut_pointer },
.data = decl.ty,