| ... | @@ -1306,15 +1306,15 @@ fn airPtrSliceFieldPtr(f: *Function, inst: Air.Inst.Index, suffix: []const u8) ! | ... | @@ -1306,15 +1306,15 @@ fn airPtrSliceFieldPtr(f: *Function, inst: Air.Inst.Index, suffix: []const u8) ! |
| 1306 | | 1306 | |
| 1307 | fn airPtrElemVal(f: *Function, inst: Air.Inst.Index) !CValue { | 1307 | fn airPtrElemVal(f: *Function, inst: Air.Inst.Index) !CValue { |
| 1308 | const bin_op = f.air.instructions.items(.data)[inst].bin_op; | 1308 | const bin_op = f.air.instructions.items(.data)[inst].bin_op; |
| 1309 | const slice_ty = f.air.typeOf(bin_op.lhs); | 1309 | const ptr_ty = f.air.typeOf(bin_op.lhs); |
| 1310 | if (!slice_ty.isVolatilePtr() and f.liveness.isUnused(inst)) return CValue.none; | 1310 | if (!ptr_ty.isVolatilePtr() and f.liveness.isUnused(inst)) return CValue.none; |
| 1311 | | 1311 | |
| 1312 | const arr = try f.resolveInst(bin_op.lhs); | 1312 | const ptr = try f.resolveInst(bin_op.lhs); |
| 1313 | const index = try f.resolveInst(bin_op.rhs); | 1313 | const index = try f.resolveInst(bin_op.rhs); |
| 1314 | const writer = f.object.writer(); | 1314 | const writer = f.object.writer(); |
| 1315 | const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const); | 1315 | const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const); |
| 1316 | try writer.writeAll(" = "); | 1316 | try writer.writeAll(" = "); |
| 1317 | try f.writeCValue(writer, arr); | 1317 | try f.writeCValue(writer, ptr); |
| 1318 | try writer.writeByte('['); | 1318 | try writer.writeByte('['); |
| 1319 | try f.writeCValue(writer, index); | 1319 | try f.writeCValue(writer, index); |
| 1320 | try writer.writeAll("];\n"); | 1320 | try writer.writeAll("];\n"); |
| ... | @@ -1327,12 +1327,12 @@ fn airPtrElemPtr(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -1327,12 +1327,12 @@ fn airPtrElemPtr(f: *Function, inst: Air.Inst.Index) !CValue { |
| 1327 | const ty_pl = f.air.instructions.items(.data)[inst].ty_pl; | 1327 | const ty_pl = f.air.instructions.items(.data)[inst].ty_pl; |
| 1328 | const bin_op = f.air.extraData(Air.Bin, ty_pl.payload).data; | 1328 | const bin_op = f.air.extraData(Air.Bin, ty_pl.payload).data; |
| 1329 | | 1329 | |
| 1330 | const arr = try f.resolveInst(bin_op.lhs); | 1330 | const ptr = try f.resolveInst(bin_op.lhs); |
| 1331 | const index = try f.resolveInst(bin_op.rhs); | 1331 | const index = try f.resolveInst(bin_op.rhs); |
| 1332 | const writer = f.object.writer(); | 1332 | const writer = f.object.writer(); |
| 1333 | const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const); | 1333 | const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const); |
| 1334 | try writer.writeAll(" = &"); | 1334 | try writer.writeAll(" = &"); |
| 1335 | try f.writeCValue(writer, arr); | 1335 | try f.writeCValue(writer, ptr); |
| 1336 | try writer.writeByte('['); | 1336 | try writer.writeByte('['); |
| 1337 | try f.writeCValue(writer, index); | 1337 | try f.writeCValue(writer, index); |
| 1338 | try writer.writeAll("];\n"); | 1338 | try writer.writeAll("];\n"); |