diff options
| author | riverbl <94326797+riverbl@users.noreply.github.com> | 2023-08-23 20:30:03 +0100 |
|---|---|---|
| committer | riverbl <94326797+riverbl@users.noreply.github.com> | 2023-08-23 20:34:59 +0100 |
| commit | 87557b37c6fb112d9608bb4b6ba860f42febf188 (patch) | |
| tree | f92b0e4b2440c4ad4e04304cd21a524fa5fd34b3 /src/arch/wasm/CodeGen.zig | |
| parent | 383e6ffc7b9e22613f4c4b15ebdcd2bf487573d6 (diff) | |
| download | zig-87557b37c6fb112d9608bb4b6ba860f42febf188.tar.gz zig-87557b37c6fb112d9608bb4b6ba860f42febf188.zip | |
Replace `@panic` with `unreachable`, add test
Replace `@panic` with `unreachable` in stage2 wasm `@divFloor` implementation
Add test for division and remainder operations for stage2 wasm
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
| -rw-r--r-- | src/arch/wasm/CodeGen.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig index bad99e9f59..db6daa8c21 100644 --- a/src/arch/wasm/CodeGen.zig +++ b/src/arch/wasm/CodeGen.zig @@ -6429,7 +6429,7 @@ fn airDivFloor(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { const zero = switch (wasm_bits) { 32 => WValue{ .imm32 = 0 }, 64 => WValue{ .imm64 = 0 }, - else => @panic("Unexpected wasm integer width"), + else => unreachable, }; // tee leaves the value on the stack and stores it in a local. @@ -6458,7 +6458,7 @@ fn airDivFloor(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { try func.addTag(.i64_extend_i32_u); try func.addTag(.i64_sub); }, - else => @panic("Unexpected wasm integer width"), + else => unreachable, } _ = try func.binOp(lhs_wasm, rhs_wasm, ty, .rem); |
