Skip to content

Commit 0b721c7

Browse files
committed
Update to parity-wasm 0.42.2
based on @jiayihu's proposal in f7235e1
1 parent c7c5042 commit 0b721c7

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude = [ "/res/*", "/tests/*", "/fuzz/*", "/benches/*" ]
1313

1414
[dependencies]
1515
validation = { package = "wasmi-validation", version = "0.3", path = "validation", default-features = false }
16-
parity-wasm = { version = "0.41.0", default-features = false }
16+
parity-wasm = { version = "0.42.0", default-features = false }
1717
memory_units = "0.3.0"
1818
libm = { version = "0.2.1", optional = true }
1919
num-rational = { version = "0.2.2", default-features = false }

src/prepare/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn deny_floating_point(module: &Module) -> Result<(), Error> {
154154
if func
155155
.params()
156156
.iter()
157-
.chain(func.return_type().as_ref())
157+
.chain(func.results().first())
158158
.any(|&typ| typ == ValueType::F32 || typ == ValueType::F64)
159159
{
160160
return Err(Error("Use of floating point types denied".to_string()));

src/types.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ impl Signature {
6565
.cloned()
6666
.map(ValueType::from_elements)
6767
.collect(),
68-
return_type: func_type.return_type().map(ValueType::from_elements),
68+
return_type: func_type
69+
.results()
70+
.first()
71+
.map(|vty| ValueType::from_elements(*vty)),
6972
}
7073
}
7174
}

validation/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "wasmi-validation"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
66
license = "MIT/Apache-2.0"
77
repository = "https://github.com/paritytech/wasmi"
88
description = "Wasm code validator"
99

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

1313
[dev-dependencies]
1414
assert_matches = "1.1"

validation/src/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ impl ModuleContext {
6363

6464
let params = ty.params();
6565
let return_ty = ty
66-
.return_type()
67-
.map(BlockType::Value)
66+
.results()
67+
.first()
68+
.map(|vty| BlockType::Value(*vty))
6869
.unwrap_or(BlockType::NoResult);
6970
Ok((params, return_ty))
7071
}

validation/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn funcs() {
201201
let m = module()
202202
.function()
203203
.signature()
204-
.return_type()
204+
.result()
205205
.i32()
206206
.build()
207207
.body()
@@ -213,7 +213,7 @@ fn funcs() {
213213
.build()
214214
.function()
215215
.signature()
216-
.return_type()
216+
.result()
217217
.i32()
218218
.build()
219219
.body()

0 commit comments

Comments
 (0)