diff --git a/Cargo.toml b/Cargo.toml index 01bfaf58ac..6ad3f8b669 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ wabt = "0.9" libc = "0.2.60" errno = "0.2.4" rayon = "1.1" -wasm-webidl-bindings = "0.4" +wasm-webidl-bindings = "0.5" # build.rs tests whether to enable a workaround for the libc strtof function. [target.'cfg(target_os = "linux")'.build-dependencies] diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 2b56dd6c3a..59095b8006 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -15,7 +15,7 @@ cranelift-codegen = { version = "0.44.0", features = ["enable-serde"] } cranelift-wasm = { version = "0.44.0", features = ["enable-serde"] } cranelift-native = "0.44.0" libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" } -wasmparser = { version = "0.36.0", default-features = false } +wasmparser = { version = "0.39.1", default-features = false } binaryen = "0.5.0" [features] diff --git a/wasmtime-api/Cargo.toml b/wasmtime-api/Cargo.toml index a401252b6b..ff804bddac 100644 --- a/wasmtime-api/Cargo.toml +++ b/wasmtime-api/Cargo.toml @@ -20,7 +20,7 @@ cranelift-frontend = "0.44.0" wasmtime-runtime = { path="../wasmtime-runtime" } wasmtime-environ = { path="../wasmtime-environ" } wasmtime-jit = { path="../wasmtime-jit" } -wasmparser = "0.36" +wasmparser = "0.39.1" failure = { version = "0.1.3", default-features = false } failure_derive = { version = "0.1.3", default-features = false } target-lexicon = { version = "0.8.1", default-features = false } diff --git a/wasmtime-api/src/module.rs b/wasmtime-api/src/module.rs index 2383c2fb1a..436aa8a146 100644 --- a/wasmtime-api/src/module.rs +++ b/wasmtime-api/src/module.rs @@ -189,7 +189,7 @@ impl Module { &self.binary } pub fn validate(_store: &Store, binary: &[u8]) -> bool { - validate(binary, None) + validate(binary, None).is_ok() } pub fn imports(&self) -> &[ImportType] { &self.imports diff --git a/wasmtime-debug/Cargo.toml b/wasmtime-debug/Cargo.toml index e5aaf1a1c3..6bc77fcdcb 100644 --- a/wasmtime-debug/Cargo.toml +++ b/wasmtime-debug/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] gimli = "0.19.0" -wasmparser = { version = "0.36.0" } +wasmparser = { version = "0.39.1" } cranelift-codegen = { version = "0.44.0", features = ["enable-serde"] } cranelift-entity = { version = "0.44.0", features = ["enable-serde"] } cranelift-wasm = { version = "0.44.0", features = ["enable-serde"] } diff --git a/wasmtime-interface-types/Cargo.toml b/wasmtime-interface-types/Cargo.toml index e14d972eff..5bea175d3b 100644 --- a/wasmtime-interface-types/Cargo.toml +++ b/wasmtime-interface-types/Cargo.toml @@ -13,8 +13,8 @@ edition = "2018" [dependencies] cranelift-codegen = "0.44.0" failure = "0.1" -walrus = "0.11.0" -wasmparser = "0.36.0" -wasm-webidl-bindings = "0.4.0" +walrus = "0.12.0" +wasmparser = "0.39.1" +wasm-webidl-bindings = "0.5.0" wasmtime-jit = { path = '../wasmtime-jit' } wasmtime-runtime = { path = '../wasmtime-runtime' } diff --git a/wasmtime-jit/Cargo.toml b/wasmtime-jit/Cargo.toml index b7c173cf93..2b000a0fad 100644 --- a/wasmtime-jit/Cargo.toml +++ b/wasmtime-jit/Cargo.toml @@ -23,7 +23,7 @@ failure = { version = "0.1.3", default-features = false } failure_derive = { version = "0.1.3", default-features = false } target-lexicon = { version = "0.8.1", default-features = false } hashbrown = { version = "0.6.0", optional = true } -wasmparser = "0.36.0" +wasmparser = "0.39.1" [features] default = ["std"] diff --git a/wasmtime-jit/src/context.rs b/wasmtime-jit/src/context.rs index b04dd5d7a5..144f066e75 100644 --- a/wasmtime-jit/src/context.rs +++ b/wasmtime-jit/src/context.rs @@ -4,7 +4,6 @@ use crate::{ SetupError, }; use cranelift_codegen::isa::TargetIsa; -use std::borrow::ToOwned; use std::boxed::Box; use std::cell::RefCell; use std::collections::HashMap; @@ -116,12 +115,8 @@ impl Context { fn validate(&mut self, data: &[u8]) -> Result<(), String> { // TODO: Fix Cranelift to be able to perform validation itself, rather // than calling into wasmparser ourselves here. - if validate(data, Some(self.features.clone().into())) { - Ok(()) - } else { - // TODO: Work with wasmparser to get better error messages. - Err("module did not validate".to_owned()) - } + validate(data, Some(self.features.clone().into())) + .map_err(|e| format!("module did not validate: {}", e.to_string())) } fn instantiate(&mut self, data: &[u8]) -> Result {