authorgravatar for reserveblue@protonmail.comdrew <reserveblue@protonmail.com> 2021-11-15 18:07:48-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-16 16:51:31-07:00
loga1d760416293b20b6a6a72f39a5957fbf22187cc
tree2311b2f413981498b86522b8a839f70877b919ed
parent0249344a479a8eb51637c04fdecd947445ece0d5

correct misnamed variables caused by copy-paste


1 files changed, 6 insertions(+), 6 deletions(-)

src/codegen/c.zig+6-6
...@@ -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) !
13061306
1307fn airPtrElemVal(f: *Function, inst: Air.Inst.Index) !CValue {1307fn 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;
13111311
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;
13291329
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");