Skip to content

Commit

Permalink
Rollup merge of #67065 - alexcrichton:update-wasi, r=sfackler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JohnTitor committed Dec 6, 2019
2 parents 1bb868c + f7789ad commit f77b8d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/sys/wasi/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn maybe_args() -> Option<Vec<OsString>> {
let mut argv = Vec::with_capacity(argc);
let mut buf = Vec::with_capacity(buf_size);
wasi::args_get(argv.as_mut_ptr(), buf.as_mut_ptr()).ok()?;
argv.set_len(argc);
let mut ret = Vec::with_capacity(argc);
for ptr in argv {
let s = CStr::from_ptr(ptr.cast());
Expand Down

0 comments on commit f77b8d3

Please sign in to comment.