mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
cbe: avoid emitting code for zero-bit field access
This commit is contained in:
parent
fb8c08d4ac
commit
8e52be1602
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user