c: fix switch on bool warning

This commit is contained in:
Jacob Young
2022-10-05 04:57:27 -04:00
parent da939b032e
commit 61bf43d790

View File

@@ -3180,6 +3180,7 @@ fn airSwitchBr(f: *Function, inst: Air.Inst.Index) !CValue {
const writer = f.object.writer();
try writer.writeAll("switch (");
if (condition_ty.tag() == .bool) try writer.writeAll("(int)");
try f.writeCValue(writer, condition);
try writer.writeAll(") {");
f.object.indent_writer.pushIndent();