Update to latest walrus, wasmparser, and wasm-webidl-bindings.

This commit is contained in:
Dan Gohman
2019-09-25 22:04:41 -07:00
parent 622a630acd
commit 10845134f7
8 changed files with 11 additions and 16 deletions

View File

@@ -37,7 +37,7 @@ wabt = "0.9"
libc = "0.2.60" libc = "0.2.60"
errno = "0.2.4" errno = "0.2.4"
rayon = "1.1" 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. # build.rs tests whether to enable a workaround for the libc strtof function.
[target.'cfg(target_os = "linux")'.build-dependencies] [target.'cfg(target_os = "linux")'.build-dependencies]

View File

@@ -15,7 +15,7 @@ cranelift-codegen = { version = "0.44.0", features = ["enable-serde"] }
cranelift-wasm = { version = "0.44.0", features = ["enable-serde"] } cranelift-wasm = { version = "0.44.0", features = ["enable-serde"] }
cranelift-native = "0.44.0" cranelift-native = "0.44.0"
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" } 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" binaryen = "0.5.0"
[features] [features]

View File

@@ -20,7 +20,7 @@ cranelift-frontend = "0.44.0"
wasmtime-runtime = { path="../wasmtime-runtime" } wasmtime-runtime = { path="../wasmtime-runtime" }
wasmtime-environ = { path="../wasmtime-environ" } wasmtime-environ = { path="../wasmtime-environ" }
wasmtime-jit = { path="../wasmtime-jit" } wasmtime-jit = { path="../wasmtime-jit" }
wasmparser = "0.36" wasmparser = "0.39.1"
failure = { version = "0.1.3", default-features = false } failure = { version = "0.1.3", default-features = false }
failure_derive = { 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 } target-lexicon = { version = "0.8.1", default-features = false }

View File

@@ -189,7 +189,7 @@ impl Module {
&self.binary &self.binary
} }
pub fn validate(_store: &Store, binary: &[u8]) -> bool { pub fn validate(_store: &Store, binary: &[u8]) -> bool {
validate(binary, None) validate(binary, None).is_ok()
} }
pub fn imports(&self) -> &[ImportType] { pub fn imports(&self) -> &[ImportType] {
&self.imports &self.imports

View File

@@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
gimli = "0.19.0" gimli = "0.19.0"
wasmparser = { version = "0.36.0" } wasmparser = { version = "0.39.1" }
cranelift-codegen = { version = "0.44.0", features = ["enable-serde"] } cranelift-codegen = { version = "0.44.0", features = ["enable-serde"] }
cranelift-entity = { 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"] } cranelift-wasm = { version = "0.44.0", features = ["enable-serde"] }

View File

@@ -13,8 +13,8 @@ edition = "2018"
[dependencies] [dependencies]
cranelift-codegen = "0.44.0" cranelift-codegen = "0.44.0"
failure = "0.1" failure = "0.1"
walrus = "0.11.0" walrus = "0.12.0"
wasmparser = "0.36.0" wasmparser = "0.39.1"
wasm-webidl-bindings = "0.4.0" wasm-webidl-bindings = "0.5.0"
wasmtime-jit = { path = '../wasmtime-jit' } wasmtime-jit = { path = '../wasmtime-jit' }
wasmtime-runtime = { path = '../wasmtime-runtime' } wasmtime-runtime = { path = '../wasmtime-runtime' }

View File

@@ -23,7 +23,7 @@ failure = { version = "0.1.3", default-features = false }
failure_derive = { 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 } target-lexicon = { version = "0.8.1", default-features = false }
hashbrown = { version = "0.6.0", optional = true } hashbrown = { version = "0.6.0", optional = true }
wasmparser = "0.36.0" wasmparser = "0.39.1"
[features] [features]
default = ["std"] default = ["std"]

View File

@@ -4,7 +4,6 @@ use crate::{
SetupError, SetupError,
}; };
use cranelift_codegen::isa::TargetIsa; use cranelift_codegen::isa::TargetIsa;
use std::borrow::ToOwned;
use std::boxed::Box; use std::boxed::Box;
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::HashMap; use std::collections::HashMap;
@@ -116,12 +115,8 @@ impl Context {
fn validate(&mut self, data: &[u8]) -> Result<(), String> { fn validate(&mut self, data: &[u8]) -> Result<(), String> {
// TODO: Fix Cranelift to be able to perform validation itself, rather // TODO: Fix Cranelift to be able to perform validation itself, rather
// than calling into wasmparser ourselves here. // than calling into wasmparser ourselves here.
if validate(data, Some(self.features.clone().into())) { validate(data, Some(self.features.clone().into()))
Ok(()) .map_err(|e| format!("module did not validate: {}", e.to_string()))
} else {
// TODO: Work with wasmparser to get better error messages.
Err("module did not validate".to_owned())
}
} }
fn instantiate(&mut self, data: &[u8]) -> Result<InstanceHandle, SetupError> { fn instantiate(&mut self, data: &[u8]) -> Result<InstanceHandle, SetupError> {