Browse Source

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

pull/385/head
Dan Gohman 5 years ago
parent
commit
10845134f7
  1. 2
      Cargo.toml
  2. 2
      fuzz/Cargo.toml
  3. 2
      wasmtime-api/Cargo.toml
  4. 2
      wasmtime-api/src/module.rs
  5. 2
      wasmtime-debug/Cargo.toml
  6. 6
      wasmtime-interface-types/Cargo.toml
  7. 2
      wasmtime-jit/Cargo.toml
  8. 9
      wasmtime-jit/src/context.rs

2
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]

2
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]

2
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 }

2
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

2
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"] }

6
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' }

2
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"]

9
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<InstanceHandle, SetupError> {

Loading…
Cancel
Save