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.
432: feat(runtime-c-api) Check buffer size before creating the slice, and fix `wasmer_last_error_message` returned value r=Hywan a=Hywan
It's safer to check the buffer size is large enough to hold the error
message before creating the slice from raw parts.
Also, this patch remove the need for `last_error`, simplifying the
code a little bit. The `length` variable is casted to `usize` once.
This patch also updates the returned value of `wasmer_last_error_message` by adding 1, so that it mimics the `wasmer_last_error_length` function that counts the trailing null byte.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
435: Fix f32/f64 conversion, add tests, and rename conversion method r=syrusakbary a=bjfish
Fixes#415
I believe removing this conversion here caused the regression: https://github.com/wasmerio/wasmer/pull/379/files#diff-5e7e23717d05d1d18be5b2e3b75f454dL158
I've added conversion tests and also renamed `NativeWasmType::{to_bits, from_bits}` to `to_binary/from_binary` because it seemed akward to overload the existing `f32::to_bits` method.
Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
429: implement some FS operations for rsign2 r=MarkMcCaskey a=MarkMcCaskey
Get https://github.com/jedisct1/rsign2 working with WASI on Wasmer (for end-to-end tests of wapm)
Current implementation is very hacky, but works! It should have a couple passes of improvement before shipping
Co-authored-by: Mark McCaskey <mark@wasmer.io>
It's safer to check the buffer size is large enough to hold the error
message before creating the slice from raw parts.
Also, this patch remove the need for `last_error`, simplifying the
code a little bit. The `length` variable is casted to `usize` once.
413: Use the new code generator API for LLVM backend. r=syrusakbary a=losfair
Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
428: Fix Windows crash on caching compiled artifact. r=syrusakbary a=repi
Memory clone function wasn't able to write to new reserved memory object.
Changed so allocating Memory objects with protection flag allocates commited memory. And added unit test to verify that it doedsn't crash anymore.
Not fully sure this is the best solution though, but fixes this specific clone crash.
Co-authored-by: Johan Andersson <repi@repi.se>
Memory clone function wasn't able to write to new reserved memory object.
Changed so allocating Memory objects with protection flag allocates commited memory.