aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-19 14:12:13 -0400
committerGitHub <noreply@github.com>2022-04-19 14:12:13 -0400
commit9c2cbe39c2caa9137e1123fcdf2f326282cad1b5 (patch)
treeda31a6f7307bcf03a87be3c7497600667b3a7c25 /src/arch/wasm/CodeGen.zig
parent78f26b970e1c5c288e45d0edd2ab2f229e6fe924 (diff)
parentbe08d2bdbd2f64ccb9ef0f985a57a4bf89b9aebb (diff)
downloadzig-9c2cbe39c2caa9137e1123fcdf2f326282cad1b5.tar.gz
zig-9c2cbe39c2caa9137e1123fcdf2f326282cad1b5.zip
Merge pull request #11461 from Luukdegram/wasm-debug-info
Wasm: add support for debug information
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index ab0deb9f63..e58a3a6d65 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -871,7 +871,8 @@ fn genFunc(self: *Self) InnerError!void {
// we emit an unreachable instruction to tell the stack validator that part will never be reached.
if (func_type.returns.len != 0 and self.air.instructions.len > 0) {
const inst = @intCast(u32, self.air.instructions.len - 1);
- if (self.air.typeOfIndex(inst).isNoReturn()) {
+ const last_inst_ty = self.air.typeOfIndex(inst);
+ if (!last_inst_ty.hasRuntimeBitsIgnoreComptime() or last_inst_ty.isNoReturn()) {
try self.addTag(.@"unreachable");
}
}