aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 8bcb485e84..269383884d 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -4223,9 +4223,11 @@ fn airStructFieldVal(f: *Function, inst: Air.Inst.Index) !CValue {
if (f.liveness.isUnused(inst))
return CValue.none;
+ const inst_ty = f.air.typeOfIndex(inst);
+ if (!inst_ty.hasRuntimeBitsIgnoreComptime()) return CValue.none;
+
const ty_pl = f.air.instructions.items(.data)[inst].ty_pl;
const extra = f.air.extraData(Air.StructField, ty_pl.payload).data;
- const inst_ty = f.air.typeOfIndex(inst);
const target = f.object.dg.module.getTarget();
const struct_byval = try f.resolveInst(extra.struct_operand);
const struct_ty = f.air.typeOf(extra.struct_operand);