Skip to content

Commit f77b8d3

Browse files
authored
Rollup merge of #67065 - alexcrichton:update-wasi, r=sfackler
Fix fetching arguments on the wasm32-wasi target Fixes an error introduced in #66750 where wasi executables always think they have zero arguments because one of the vectors returned here accidentally thought it was length 0.
2 parents 1bb868c + f7789ad commit f77b8d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libstd/sys/wasi/args.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn maybe_args() -> Option<Vec<OsString>> {
2626
let mut argv = Vec::with_capacity(argc);
2727
let mut buf = Vec::with_capacity(buf_size);
2828
wasi::args_get(argv.as_mut_ptr(), buf.as_mut_ptr()).ok()?;
29+
argv.set_len(argc);
2930
let mut ret = Vec::with_capacity(argc);
3031
for ptr in argv {
3132
let s = CStr::from_ptr(ptr.cast());

0 commit comments

Comments
 (0)