aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-24 22:27:40 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-11-24 22:44:33 -0700
commitb560f46c871f234a8b2f762c03984eef963f360a (patch)
tree4c82363776185796842c5b4a505444381a77e67e /src/arch/wasm/CodeGen.zig
parenta130eac7857512db50320fb1c64079b0d696885d (diff)
downloadzig-b560f46c871f234a8b2f762c03984eef963f360a.tar.gz
zig-b560f46c871f234a8b2f762c03984eef963f360a.zip
stage2: fix unwrap function call with optional pointer return value
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index f6ccb6d8eb..468ccbea51 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -848,6 +848,11 @@ pub fn gen(self: *Self, ty: Type, val: Value) InnerError!Result {
try self.emitConstant(val, ty);
return Result.appended;
},
+ .Bool => {
+ const int_byte: u8 = @boolToInt(val.toBool());
+ try self.code.append(int_byte);
+ return Result.appended;
+ },
.Struct => {
// TODO write the fields for real
const abi_size = try std.math.cast(usize, ty.abiSize(self.target));