Skip to content

Commit

Permalink
Update to parity-wasm 0.42.2 (#251)
Browse files Browse the repository at this point in the history
based on @jiayihu's proposal in f7235e1
  • Loading branch information
ithinuel authored Mar 17, 2021
1 parent c7c5042 commit f5fd480
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exclude = [ "/res/*", "/tests/*", "/fuzz/*", "/benches/*" ]

[dependencies]
validation = { package = "wasmi-validation", version = "0.3", path = "validation", default-features = false }
parity-wasm = { version = "0.41.0", default-features = false }
parity-wasm = { version = "0.42.0", default-features = false }
memory_units = "0.3.0"
libm = { version = "0.2.1", optional = true }
num-rational = { version = "0.2.2", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/prepare/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub fn deny_floating_point(module: &Module) -> Result<(), Error> {
if func
.params()
.iter()
.chain(func.return_type().as_ref())
.chain(func.results())
.any(|&typ| typ == ValueType::F32 || typ == ValueType::F64)
{
return Err(Error("Use of floating point types denied".to_string()));
Expand Down
5 changes: 4 additions & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ impl Signature {
.cloned()
.map(ValueType::from_elements)
.collect(),
return_type: func_type.return_type().map(ValueType::from_elements),
return_type: func_type
.results()
.first()
.map(|vty| ValueType::from_elements(*vty)),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions validation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "wasmi-validation"
version = "0.3.0"
version = "0.3.1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "MIT/Apache-2.0"
repository = "https://github.com/paritytech/wasmi"
description = "Wasm code validator"

[dependencies]
parity-wasm = { version = "0.41.0", default-features = false }
parity-wasm = { version = "0.42.0", default-features = false }

[dev-dependencies]
assert_matches = "1.1"
Expand Down
5 changes: 3 additions & 2 deletions validation/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ impl ModuleContext {

let params = ty.params();
let return_ty = ty
.return_type()
.map(BlockType::Value)
.results()
.first()
.map(|vty| BlockType::Value(*vty))
.unwrap_or(BlockType::NoResult);
Ok((params, return_ty))
}
Expand Down
4 changes: 2 additions & 2 deletions validation/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn funcs() {
let m = module()
.function()
.signature()
.return_type()
.result()
.i32()
.build()
.body()
Expand All @@ -213,7 +213,7 @@ fn funcs() {
.build()
.function()
.signature()
.return_type()
.result()
.i32()
.build()
.body()
Expand Down

0 comments on commit f5fd480

Please sign in to comment.