Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to parity-wasm 0.42.2 #251

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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