zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 161eb4a000923c28d152781dcc8a080905c7ad32 (tree)
parent a6dc2b7fcc2e1e73130eb0e762cac4ab884d20c2
Author: Sébastien Marie <semarie@online.fr>
Date:   Sun, 11 Oct 2020 12:25:16 +0000

initialize std.os.argv in stage1 compiler. it is needed for selfExePath under OpenBSD

Diffstat:
Msrc/stage1.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/stage1.zig b/src/stage1.zig @@ -25,7 +25,9 @@ comptime { pub const log = stage2.log; pub const log_level = stage2.log_level; -pub export fn main(argc: c_int, argv: [*]const [*:0]const u8) c_int { +pub export fn main(argc: c_int, argv: [*][*:0]u8) c_int { + std.os.argv = argv[0.. @intCast(usize, argc)]; + std.debug.maybeEnableSegfaultHandler(); zig_stage1_os_init();