authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-11-28 13:04:32+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-11-30 15:14:34+02:00
log3281494dc50055dde0415cefb7dec806437741cc
tree2f44d186e61ba1c76ee438dcb244f8b2361c414e
parenta67ea4a4ae6f8392e2cf9672279aa1b2f80dab72

cbe: prevent access of inactive union field in unimplemented instructions


1 files changed, 0 insertions(+), 18 deletions(-)

src/codegen/c.zig-18
...@@ -5285,30 +5285,12 @@ fn airSplat(f: *Function, inst: Air.Inst.Index) !CValue {...@@ -5285,30 +5285,12 @@ fn airSplat(f: *Function, inst: Air.Inst.Index) !CValue {
5285fn airSelect(f: *Function, inst: Air.Inst.Index) !CValue {5285fn airSelect(f: *Function, inst: Air.Inst.Index) !CValue {
5286 if (f.liveness.isUnused(inst)) return CValue.none;5286 if (f.liveness.isUnused(inst)) return CValue.none;
52875287
5288 const inst_ty = f.air.typeOfIndex(inst);
5289 const ty_pl = f.air.instructions.items(.data)[inst].ty_pl;
5290
5291 const writer = f.object.writer();
5292 const local = try f.allocLocal(inst_ty, .Const);
5293 try writer.writeAll(" = ");
5294
5295 _ = local;
5296 _ = ty_pl;
5297 return f.fail("TODO: C backend: implement airSelect", .{});5288 return f.fail("TODO: C backend: implement airSelect", .{});
5298}5289}
52995290
5300fn airShuffle(f: *Function, inst: Air.Inst.Index) !CValue {5291fn airShuffle(f: *Function, inst: Air.Inst.Index) !CValue {
5301 if (f.liveness.isUnused(inst)) return CValue.none;5292 if (f.liveness.isUnused(inst)) return CValue.none;
53025293
5303 const inst_ty = f.air.typeOfIndex(inst);
5304 const ty_op = f.air.instructions.items(.data)[inst].ty_op;
5305 const operand = try f.resolveInst(ty_op.operand);
5306 const writer = f.object.writer();
5307 const local = try f.allocLocal(inst_ty, .Const);
5308 try writer.writeAll(" = ");
5309
5310 _ = operand;
5311 _ = local;
5312 return f.fail("TODO: C backend: implement airShuffle", .{});5294 return f.fail("TODO: C backend: implement airShuffle", .{});
5313}5295}
53145296