MotleyCoderDev / wasm2brs

Bringing the power of WebAssembly to the Roku and supporting languages like C/C++/Rust.
https://motley-coder.com/2020/12/20/webassembly-on-roku/
Other
50 stars 5 forks source link

Args are not passed to wasm programs #8

Closed iBicha closed 1 year ago

iBicha commented 1 year ago

To continue on the issue from #7, I started over with a simple test

int main(int i_argc, const char* i_argv[]) {
    printf("i_argc: %d\n", i_argc);
    for (int i = 0; i < i_argc; ++i)
    {
        printf("i_argc[%d]: %s\n", i, i_argv[i]);
    }
    return 0;
}

and

    wasi_init(m.w2b_memory, "files.wasm", { env: ["TEST=Hello"], args:["abc"]})

The output is

i_argc: 2
i_argc[0]: 
i_argc[1]: (null)

wasi_snapshot_preview1_args_sizes_get gets called twice, while wasi_snapshot_preview1_args_get is never called