mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 03:53:20 +00: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
@ -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…
x
Reference in New Issue
Block a user