Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasmer_export_func_call 0 arg error #753

Closed
liamappelbe opened this issue Sep 4, 2019 · 1 comment · Fixed by #756
Closed

wasmer_export_func_call 0 arg error #753

liamappelbe opened this issue Sep 4, 2019 · 1 comment · Fixed by #756
Assignees
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api

Comments

@liamappelbe
Copy link

wasmer_export_func_call in wasmer.hh reports "params ptr is null", even if params_len is 0. Seems like it should just ignore the params pointer if params_len is 0.

Currently I'm working around the issue like this:

std::vector<wasmer_value_t> params;
// Marshall params...

if (params.size() == 0) {
  // Wasmer requires that our params ptr is valid, even if params_len is 0.
  params.push_back(ToValueI32(0));
}

wasmer_value_t ret;
ThrowIfFailed(wasmer_export_func_call(
      fn->fn, &params[0], fn->wasm_args.size(), &ret, fn->has_ret ? 1 : 0)));
@liamappelbe liamappelbe added the bug Something isn't working label Sep 4, 2019
@Hywan Hywan self-assigned this Sep 5, 2019
@Hywan Hywan added the 📦 lib-c-api About wasmer-c-api label Sep 5, 2019
@Hywan
Copy link
Contributor

Hywan commented Sep 5, 2019

You're right! See #756 for the fix. Thanks for the bug report :-).

@bors bors bot closed this as completed in 20a0afa Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-c-api About wasmer-c-api
Projects
None yet
2 participants