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) !
13061306
13071307fn airPtrElemVal(f: *Function, inst: Air.Inst.Index) !CValue {
13081308 const bin_op = f.air.instructions.items(.data)[inst].bin_op;
1309 const slice_ty = f.air.typeOf(bin_op.lhs);
1310 if (!slice_ty.isVolatilePtr() and f.liveness.isUnused(inst)) return CValue.none;
1309 const ptr_ty = f.air.typeOf(bin_op.lhs);
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);
13131313 const index = try f.resolveInst(bin_op.rhs);
13141314 const writer = f.object.writer();
13151315 const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const);
13161316 try writer.writeAll(" = ");
1317 try f.writeCValue(writer, arr);
1317 try f.writeCValue(writer, ptr);
13181318 try writer.writeByte('[');
13191319 try f.writeCValue(writer, index);
13201320 try writer.writeAll("];\n");
......@@ -1327,12 +1327,12 @@ fn airPtrElemPtr(f: *Function, inst: Air.Inst.Index) !CValue {
13271327 const ty_pl = f.air.instructions.items(.data)[inst].ty_pl;
13281328 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);
13311331 const index = try f.resolveInst(bin_op.rhs);
13321332 const writer = f.object.writer();
13331333 const local = try f.allocLocal(f.air.typeOfIndex(inst), .Const);
13341334 try writer.writeAll(" = &");
1335 try f.writeCValue(writer, arr);
1335 try f.writeCValue(writer, ptr);
13361336 try writer.writeByte('[');
13371337 try f.writeCValue(writer, index);
13381338 try writer.writeAll("];\n");