aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 33339f589d..2ae0421008 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -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();