1
0
mirror of https://github.com/fluencelabs/wasmer synced 2025-03-18 00:50:51 +00:00
Ivan Enderlin c4c88f8af5 fix(runtime-core) Remove undefined behavior with mem::transmute.
In the `wrap` functions, we use `std::mem::transmute(&())` to get the
pointer to the value “around” `wrap` (`Fn` has a method `to_raw` which
declares a `wrap` function, which uses `transmute` to retrieve
`Fn`). This is an undefined behavior. It was working until the
`FuncCtx` is introduced. Since then, the undefined behavior was
causing an error with the Singlepass backend.

This patch stores the pointer to `Fn` in `func_env`, so that the
pointer to the user-defined host function is always predictable.
2019-11-06 14:48:46 +01:00
..
2019-10-23 13:40:35 -07:00

Wasmer logo

Build Status License Join the Wasmer Community Number of downloads from crates.io Read our API documentation

Wasmer Runtime Core

Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully compatible with WASI, Emscripten, Rust and Go. Learn more.

This crate represents the core of the runtime. Consider [wasmer-runtime] for higher level APIs.