Commit 8b734380f9

Andrew Kelley <andrew@ziglang.org>
2021-10-21 01:42:43
stage2: LLVM backend: fix decls sometimes not marked alive
Without this they could get incorrectly garbage collected.
1 parent c8ded2f
Changed files (1)
src
codegen
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,