Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce4f407

Browse files
committedMay 14, 2019
Try #440:
2 parents 7e00bef + 0749932 commit ce4f407

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Blocks of changes will separated by version increments.
66

77
## **[Unreleased]**
88

9+
- [#440](https://github.com/wasmerio/wasmer/pull/440) Fix type mismatch between `wasmer_instance_call` and `wasmer_export_func_*_arity` functions in the runtime C API.
910
- [#269](https://github.com/wasmerio/wasmer/pull/269) Add better runtime docs
1011
- [#432](https://github.com/wasmerio/wasmer/pull/432) Fix returned value of `wasmer_last_error_message` in the runtime C API
1112
- [#429](https://github.com/wasmerio/wasmer/pull/429) Get wasi::path_filestat_get working for some programs; misc. minor WASI FS improvements

‎lib/runtime-c-api/src/instance.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ pub unsafe extern "C" fn wasmer_instance_call(
125125
instance: *mut wasmer_instance_t,
126126
name: *const c_char,
127127
params: *const wasmer_value_t,
128-
params_len: c_int,
128+
params_len: uint32_t,
129129
results: *mut wasmer_value_t,
130-
results_len: c_int,
130+
results_len: uint32_t,
131131
) -> wasmer_result_t {
132132
if instance.is_null() {
133133
update_last_error(CApiError {

‎lib/runtime-c-api/tests/test-exports.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ int main()
6060
assert(returns_sig[0] == WASM_I32);
6161
free(returns_sig);
6262

63-
6463
wasmer_value_t param_one;
6564
param_one.tag = WASM_I32;
6665
param_one.value.I32 = 7;
@@ -71,7 +70,7 @@ int main()
7170
wasmer_value_t result_one;
7271
wasmer_value_t results[] = {result_one};
7372

74-
wasmer_result_t call_result = wasmer_export_func_call(func, params, 2, results, 1);
73+
wasmer_result_t call_result = wasmer_export_func_call(func, params, params_arity, results, returns_arity);
7574
printf("Call result: %d\n", call_result);
7675
printf("Result: %d\n", results[0].value.I32);
7776
assert(results[0].value.I32 == 15);

‎lib/runtime-c-api/wasmer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ wasmer_result_t wasmer_import_func_returns_arity(const wasmer_import_func_t *fun
390390
wasmer_result_t wasmer_instance_call(wasmer_instance_t *instance,
391391
const char *name,
392392
const wasmer_value_t *params,
393-
int params_len,
393+
uint32_t params_len,
394394
wasmer_value_t *results,
395-
int results_len);
395+
uint32_t results_len);
396396

397397
/**
398398
* Gets the `data` field within the context.

‎lib/runtime-c-api/wasmer.hh

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ wasmer_result_t wasmer_import_func_returns_arity(const wasmer_import_func_t *fun
313313
wasmer_result_t wasmer_instance_call(wasmer_instance_t *instance,
314314
const char *name,
315315
const wasmer_value_t *params,
316-
int params_len,
316+
uint32_t params_len,
317317
wasmer_value_t *results,
318-
int results_len);
318+
uint32_t results_len);
319319

320320
/// Gets the `data` field within the context.
321321
void *wasmer_instance_context_data_get(const wasmer_instance_context_t *ctx);

0 commit comments

Comments
 (0)
Please sign in to comment.