mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
wasm_interp: ensure WASI argv[0] is the .wasm executable
This commit is contained in:
parent
aa76634751
commit
dfbee7b916
2 changed files with 13 additions and 8 deletions
|
@ -153,7 +153,11 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
|
|||
) -> Result<Option<Value>, String> {
|
||||
let arg_type_bytes = self.prepare_to_call_export(module, fn_name)?;
|
||||
|
||||
for (value_str, type_byte) in arg_strings.into_iter().zip(arg_type_bytes.iter().copied()) {
|
||||
for (value_str, type_byte) in arg_strings
|
||||
.into_iter()
|
||||
.skip(1) // first string is the .wasm filename
|
||||
.zip(arg_type_bytes.iter().copied())
|
||||
{
|
||||
use ValueType::*;
|
||||
let value = match ValueType::from(type_byte) {
|
||||
I32 => Value::I32(value_str.parse::<i32>().map_err(|e| e.to_string())?),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue