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

feat(runtime-c-api) Allow to call wasmer_export_func_call with null inputs and a 0 arity #756

Merged
merged 5 commits into from
Sep 6, 2019

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Sep 5, 2019

Fix #753

This PR allows to call wasmer_export_func_call with inputs set to NULL, and an arity of 0. It avoids to create an empty inputs array. So basically:

wasmer_export_func_call(exported_function, NULL, 0, …, …);

instead of:

wasmer_value_t inputs = {};
wasmer_export_func_call(exported_function, inputs, 0, …, …);

This PR also updates the test suite for exports. Instead of just the famous sum function, we now test more functions, so that all Wasm types are covered, including void functions.

Finally, this PR updates the wasmer_export_func_call signature to forbid negative arities.

@Hywan Hywan added 🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api 🧪 tests I love tests labels Sep 5, 2019
@Hywan Hywan requested a review from bjfish September 5, 2019 13:15
@Hywan Hywan self-assigned this Sep 5, 2019
@Hywan
Copy link
Contributor Author

Hywan commented Sep 5, 2019

bors try

bors bot added a commit that referenced this pull request Sep 5, 2019
@bors
Copy link
Contributor

bors bot commented Sep 5, 2019

try

Build succeeded

  • wasmerio.wasmer

lib/runtime-c-api/tests/test-exports.c Outdated Show resolved Hide resolved
lib/runtime-c-api/tests/test-exports.c Outdated Show resolved Hide resolved
lib/runtime-c-api/tests/test-exports.c Outdated Show resolved Hide resolved
lib/runtime-c-api/tests/test-exports.c Outdated Show resolved Hide resolved
@Hywan
Copy link
Contributor Author

Hywan commented Sep 6, 2019

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 6, 2019

👎 Rejected by too few approved reviews

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Sep 6, 2019
756: feat(runtime-c-api) Allow to call `wasmer_export_func_call` with null inputs and a 0 arity r=syrusakbary a=Hywan

Fix #753 

This PR allows to call `wasmer_export_func_call` with inputs set to NULL, and an arity of 0. It avoids to create an empty inputs array. So basically:

```c
wasmer_export_func_call(exported_function, NULL, 0, …, …);
```

instead of:

```c
wasmer_value_t inputs = {};
wasmer_export_func_call(exported_function, inputs, 0, …, …);
```

This PR also updates the test suite for exports. Instead of just the famous `sum` function, we now test more functions, so that all Wasm types are covered, including void functions.

Finally, this PR updates the `wasmer_export_func_call` signature to forbid negative arities.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
@bors
Copy link
Contributor

bors bot commented Sep 6, 2019

Build succeeded

  • wasmerio.wasmer

@bors bors bot merged commit 1f1ecb7 into wasmerio:master Sep 6, 2019
@Hywan
Copy link
Contributor Author

Hywan commented Sep 6, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api 🧪 tests I love tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasmer_export_func_call 0 arg error
3 participants