mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
Replace unreachable with error return for non-standard Windows targets
This new error mirrors the error returned from the Elf struct (error.UnsupportedElfArchitecture):
0adcfd60f4/src/link/Lld.zig (L112)
Before:
```
$ zig build-exe -target riscv64-windows-gnu main.zig
thread 543087 panic: reached unreachable code
```
After:
```
$ zig build-exe -target riscv64-windows-gnu main.zig
error: unable to create compilation: UnsupportedCoffArchitecture
```
Closes #24287
This commit is contained in:
parent
6322dbd5bf
commit
d3363b7a61
1 changed files with 2 additions and 2 deletions
|
|
@ -37,12 +37,12 @@ const Coff = struct {
|
|||
.Exe => switch (target.cpu.arch) {
|
||||
.aarch64, .x86_64 => 0x140000000,
|
||||
.thumb, .x86 => 0x400000,
|
||||
else => unreachable,
|
||||
else => return error.UnsupportedCoffArchitecture,
|
||||
},
|
||||
.Lib => switch (target.cpu.arch) {
|
||||
.aarch64, .x86_64 => 0x180000000,
|
||||
.thumb, .x86 => 0x10000000,
|
||||
else => unreachable,
|
||||
else => return error.UnsupportedCoffArchitecture,
|
||||
},
|
||||
.Obj => 0,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue