wasm-micro-runtime
wasm-micro-runtime copied to clipboard
Calling host functions in c-api error ?
Steps to reproduce
I tried to execute test.wat
test.txt
through c-api in test-in-api.c
test-in-api.txt
.
In test.wat, it import 2 function from host (c file) : assert_eq_i32 and print_input. (This 2 function has 2 different types !)
The right way to import these 2 functions is to import assert_eq_i32 firstly and import print_input secondly. This is the order imported in wat file (line 139 in c file)
But I import print_input firstly and import assert_eq_i32 secondly.
Expected Result
The c api shows error or exception to alert that the first function I imported in c file are different from the first import function in wat file in type.
Actual Result
It alert nothing and regard function print_input as function assert_eq_i32 and regard function assert_eq_i32 as function print_input although they has different function types and output unexpected output of wat file.
Nice catching. We are going to create a PR to fix that.
Thanks a lot ! Waiting for your fixing.
we've fixed the issue in the latest commits, dd62b32b201db8e5939e1084757c712145e93264.
Close this issue as it was fixed.