diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-22 17:12:12 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-22 17:12:12 -0700 |
| commit | 01c1f415209f5085e09430cc6df182d7eb2245ee (patch) | |
| tree | 9f93de2769afd58bf1a88db0b9b266aa24bb4b66 /src/codegen/c.zig | |
| parent | b24e9b6347afc66aa94f61b3ed4c2d02cdb0d0ee (diff) | |
| download | zig-01c1f415209f5085e09430cc6df182d7eb2245ee.tar.gz zig-01c1f415209f5085e09430cc6df182d7eb2245ee.zip | |
stage2: slice and alignment fixes
* Fix backend using wrong union field of the slice instruction.
* LLVM backend properly sets alignment on global variables.
* Sema: add coercion for *T to *[1]T
* Sema: pointers to Decls with explicit alignment now have alignment
metadata in them.
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index aa1ece7ba3..dd71590566 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -1663,7 +1663,8 @@ fn airMinMax(f: *Function, inst: Air.Inst.Index, operator: [*:0]const u8) !CValu fn airSlice(f: *Function, inst: Air.Inst.Index) !CValue { if (f.liveness.isUnused(inst)) return CValue.none; - const bin_op = f.air.instructions.items(.data)[inst].bin_op; + const ty_pl = f.air.instructions.items(.data)[inst].ty_pl; + const bin_op = f.air.extraData(Air.Bin, ty_pl.payload).data; const ptr = try f.resolveInst(bin_op.lhs); const len = try f.resolveInst(bin_op.rhs); |
