Compiler segfault when using `-fno-emit-bin` and `-fno-LLVM` at the same time
Zig Version
0.10.0-dev.263+c5ee73f65
Steps to Reproduce
$ zig build-exe -fno-emit-bin -fno-LLVM nonexistent_file.zig
Expected Behavior
error: unable to load 'nonexistent_file.zig': FileNotFound
Actual Behavior
fish: “zig build-exe -fno-emit-bin -fn…” terminated by signal SIGSEGV (Address boundary error)
I tested the example on Linux, with Zig stage1 version 0.10.0-dev.2306+50a5ddecc and with Zig stage2 version 0.10.0-dev.2117+e8c85450f and it works correctly.
@windows-h8r, can you check if it also works for you, with a recent version of Zig? Was the example executed on Windows?
@perillo No, it was executed on Linux. Now, it works on my computer with the latest version of Zig.
@windows-h8r Thanks. @Vexu Ping.
Still crashes for me using a debug build of stage2.
I missed the "nonexistent" part which does seem to be fixed, but using an existing file will still panic with "attempt to use null value".
I missed the "nonexistent" part which does seem to be fixed, but using an existing file will still panic with "attempt to use null value".
Can no longer reproduce this on 0.12.0-dev.601+f4c884617:
# debug build, 0.12.0-dev.601+f4c884617
$ zig build-exe -fno-emit-bin -fno-llvm main.zig # no panic
$ zig build-exe -fno-emit-bin -fno-llvm -fno-libllvm main.zig # no panic
--verbose-air etc. works so it indeed analyze this and not just discards everything.