Skip to content

Commit 8f1bbd6

Browse files
committed
Auto merge of #66873 - RalfJung:miri-args, r=dtolnay
really_init cmdline args on Miri r? @joshtriplett Closes #66862.
2 parents 9081929 + f621c25 commit 8f1bbd6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libstd/sys/unix/args.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ mod imp {
8080

8181
#[inline(always)]
8282
pub unsafe fn init(_argc: isize, _argv: *const *const u8) {
83-
#[cfg(not(all(target_os = "linux", target_env = "gnu")))]
83+
// On Linux-GNU, we rely on `ARGV_INIT_ARRAY` below to initialize
84+
// `ARGC` and `ARGV`. But in Miri that does not actually happen so we
85+
// still initialize here.
86+
#[cfg(any(
87+
miri,
88+
not(all(target_os = "linux", target_env = "gnu"))
89+
))]
8490
really_init(_argc, _argv);
8591
}
8692

0 commit comments

Comments
 (0)