Add a crate to interface with the WebAssembly spec interpreter
The WebAssembly spec interpreter is written in OCaml and the new crate uses `ocaml-interop` along with a small OCaml wrapper to interpret Wasm modules in-process. The build process for this crate is currently Linux-specific: it requires several OCaml packages (e.g. `apt install -y ocaml-nox ocamlbuild`) as well as `make`, `cp`, and `ar`.
This commit is contained in:
17
crates/fuzzing/wasm-spec-interpreter/src/without_library.rs
Normal file
17
crates/fuzzing/wasm-spec-interpreter/src/without_library.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
//! Panic when interpreting WebAssembly modules; see the rationale for this in
|
||||
//! `lib.rs`.
|
||||
//!
|
||||
//! ```should_panic
|
||||
//! # use wasm_spec_interpreter::interpret;
|
||||
//! let _ = interpret(&[], vec![]);
|
||||
//! ```
|
||||
|
||||
use crate::Value;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn interpret(_module: &[u8], _parameters: Vec<Value>) -> Result<Vec<Value>, String> {
|
||||
panic!(
|
||||
"wasm-spec-interpreter was built without its Rust-to-OCaml shim \
|
||||
library; re-compile with the dependencies listed in its README.md."
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user