From 32c90cb5539c3b340ae1b0b13d2b1521ebb6b1b0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 9 Jun 2022 19:23:36 -0700 Subject: stage2: fix handling of aggregates with mixed comptime-only fields --- src/codegen/llvm.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/codegen/llvm.zig') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 188c2f6f11..bda81711fb 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -9185,7 +9185,7 @@ fn isByRef(ty: Type) bool { .AnyFrame, => return false, - .Array, .Frame => return ty.hasRuntimeBitsIgnoreComptime(), + .Array, .Frame => return ty.hasRuntimeBits(), .Struct => { // Packed structs are represented to LLVM as integers. if (ty.containerLayout() == .Packed) return false; @@ -9204,7 +9204,7 @@ fn isByRef(ty: Type) bool { var count: usize = 0; const fields = ty.structFields(); for (fields.values()) |field| { - if (field.is_comptime or !field.ty.hasRuntimeBitsIgnoreComptime()) continue; + if (field.is_comptime or !field.ty.hasRuntimeBits()) continue; count += 1; if (count > max_fields_byval) return true; @@ -9212,7 +9212,7 @@ fn isByRef(ty: Type) bool { } return false; }, - .Union => return ty.hasRuntimeBitsIgnoreComptime(), + .Union => return ty.hasRuntimeBits(), .ErrorUnion => return isByRef(ty.errorUnionPayload()), .Optional => { var buf: Type.Payload.ElemType = undefined; -- cgit v1.2.3