-
Notifications
You must be signed in to change notification settings - Fork 824
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
fix(runtime-c-api) wasmer_instance_call
types must matche wasmer_export_func_*_arity
#440
Merged
bors
merged 8 commits into
wasmerio:master
from
Hywan:fix-runtime-c-api-wasmer-install-call-arity-type
May 14, 2019
Merged
fix(runtime-c-api) wasmer_instance_call
types must matche wasmer_export_func_*_arity
#440
bors
merged 8 commits into
wasmerio:master
from
Hywan:fix-runtime-c-api-wasmer-install-call-arity-type
May 14, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t_func_*_arity`. The `wasmer_export_func_params_arity` and `wasmer_export_func_returns_arity` functions store the arity in a `uint32_t`. The `wasmer_instance_call` expects `c_int`. There is a type mismatch here. It's not annoying in C or C++, but in some other languages that have bindings to C/C++, it can imply useless casting. This patch changes `wasmer_instance_call` to expect `uint32_t` for `params_len` and `results_len` to match the `wasmer_export_func_*_arity` functions.
Hywan
added
bug
Something isn't working
📦 lib-c-api
About wasmer-c-api
🧪 tests
I love tests
labels
May 14, 2019
bors try |
Hywan
changed the title
fix(runtime-c-api)
fix(runtime-c-api) May 14, 2019
wasmer_instance_call
types matches wasmer_export_func_*_arity
wasmer_instance_call
types must matches wasmer_export_func_*_arity
Hywan
changed the title
fix(runtime-c-api)
fix(runtime-c-api) May 14, 2019
wasmer_instance_call
types must matches wasmer_export_func_*_arity
wasmer_instance_call
types must matche wasmer_export_func_*_arity
The `params_len` argument type of `wasmer_export_func_params_arity` must be `uint32_t` to match the `wasmer_export_func_*_arity` results, so that casts are not required.
The `returns_len` argument type of `wasmer_export_func_returns_params` must be `uint32_t` to match the `wasmer_export_func_returns_arity` results, so that casts are not required.
bors try |
bjfish
approved these changes
May 14, 2019
bors r+ |
bors bot
added a commit
that referenced
this pull request
May 14, 2019
440: fix(runtime-c-api) `wasmer_instance_call` types must matche `wasmer_export_func_*_arity` r=Hywan a=Hywan The `wasmer_export_func_params_arity` and `wasmer_export_func_returns_arity` functions store the arity in a `uint32_t`. The `wasmer_instance_call` expects `c_int`. There is a type mismatch here. It's not annoying in C or C++, but in some other languages that have bindings to C/C++, it can imply useless casting. This patch changes `wasmer_instance_call` to expect `uint32_t` for `params_len` and `results_len` to match the `wasmer_export_func_*_arity` functions. Other patches do the same for `wasmer_export_func_params` and `wasmer_export_func_returns`. Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
wasmer_export_func_params_arity
andwasmer_export_func_returns_arity
functions store the arity in auint32_t
. Thewasmer_instance_call
expectsc_int
. There is atype mismatch here. It's not annoying in C or C++, but in some other
languages that have bindings to C/C++, it can imply useless casting.
This patch changes
wasmer_instance_call
to expectuint32_t
forparams_len
andresults_len
to match thewasmer_export_func_*_arity
functions.Other patches do the same for
wasmer_export_func_params
andwasmer_export_func_returns
.