Upgrade to parity-wasm v0.42.1

This commit is contained in:
Michael Mueller
2020-12-08 12:50:41 +01:00
parent 7da376062a
commit d6127afd1d
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "pwasm-utils" name = "pwasm-utils"
version = "0.16.0" version = "0.17.0"
edition = "2018" edition = "2018"
authors = ["Nikolay Volf <nikvolf@gmail.com>", "Sergey Pepyakin <s.pepyakin@gmail.com>"] authors = ["Nikolay Volf <nikvolf@gmail.com>", "Sergey Pepyakin <s.pepyakin@gmail.com>"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
@@ -47,7 +47,7 @@ required-features = ["cli"]
[dependencies] [dependencies]
# If you add the feature "bulk", make sure you fixed all expects that say # If you add the feature "bulk", make sure you fixed all expects that say
# "parity-wasm is compiled without bulk-memory operations" # "parity-wasm is compiled without bulk-memory operations"
parity-wasm = { version = "0.41.0", default-features = false } parity-wasm = { version = "0.42.1", default-features = false }
log = { version = "0.4", default-features = false } log = { version = "0.4", default-features = false }
byteorder = { version = "1", default-features = false } byteorder = { version = "1", default-features = false }
+3 -3
View File
@@ -11,7 +11,7 @@ use crate::std::cmp::min;
use crate::std::mem; use crate::std::mem;
use crate::std::vec::Vec; use crate::std::vec::Vec;
use parity_wasm::{elements, builder}; use parity_wasm::{elements, elements::ValueType, builder};
use crate::rules::Rules; use crate::rules::Rules;
pub fn update_call_index(instructions: &mut elements::Instructions, inserted_index: u32) { pub fn update_call_index(instructions: &mut elements::Instructions, inserted_index: u32) {
@@ -250,7 +250,7 @@ fn add_grow_counter<R: Rules>(
let mut b = builder::from_module(module); let mut b = builder::from_module(module);
b.push_function( b.push_function(
builder::function() builder::function()
.signature().params().i32().build().with_return_type(Some(elements::ValueType::I32)).build() .signature().with_param(ValueType::I32).with_result(ValueType::I32).build()
.body() .body()
.with_instructions(elements::Instructions::new(vec![ .with_instructions(elements::Instructions::new(vec![
GetLocal(0), GetLocal(0),
@@ -441,7 +441,7 @@ pub fn inject_gas_counter<R: Rules>(
let mut mbuilder = builder::from_module(module); let mut mbuilder = builder::from_module(module);
let import_sig = mbuilder.push_signature( let import_sig = mbuilder.push_signature(
builder::signature() builder::signature()
.param().i32() .with_param(ValueType::I32)
.build_sig() .build_sig()
); );
+1 -1
View File
@@ -75,7 +75,7 @@ pub fn pack_instance(raw_module: Vec<u8>, mut ctor_module: elements::Module, tar
if !func.params().is_empty() { if !func.params().is_empty() {
return Err(Error::InvalidCreateSignature(target.symbols().create)); return Err(Error::InvalidCreateSignature(target.symbols().create));
} }
if func.return_type().is_some() { if !func.results().is_empty() {
return Err(Error::InvalidCreateSignature(target.symbols().create)); return Err(Error::InvalidCreateSignature(target.symbols().create));
} }
+3 -3
View File
@@ -173,7 +173,7 @@ pub(crate) fn compute(func_idx: u32, module: &elements::Module) -> Result<u32, E
// Add implicit frame for the function. Breaks to this frame and execution of // Add implicit frame for the function. Breaks to this frame and execution of
// the last end should deal with this frame. // the last end should deal with this frame.
let func_arity: u32 = if func_signature.return_type().is_some() { let func_arity: u32 = if !func_signature.results().is_empty() {
1 1
} else { } else {
0 0
@@ -279,7 +279,7 @@ pub(crate) fn compute(func_idx: u32, module: &elements::Module) -> Result<u32, E
stack.pop_values(ty.params().len() as u32)?; stack.pop_values(ty.params().len() as u32)?;
// Push result of the function execution to the stack. // Push result of the function execution to the stack.
let callee_arity = if ty.return_type().is_some() { 1 } else { 0 }; let callee_arity = if !ty.results().is_empty() { 1 } else { 0 };
stack.push_values(callee_arity)?; stack.push_values(callee_arity)?;
} }
CallIndirect(x, _) => { CallIndirect(x, _) => {
@@ -295,7 +295,7 @@ pub(crate) fn compute(func_idx: u32, module: &elements::Module) -> Result<u32, E
stack.pop_values(ty.params().len() as u32)?; stack.pop_values(ty.params().len() as u32)?;
// Push result of the function execution to the stack. // Push result of the function execution to the stack.
let callee_arity = if ty.return_type().is_some() { 1 } else { 0 }; let callee_arity = if !ty.results().is_empty() { 1 } else { 0 };
stack.push_values(callee_arity)?; stack.push_values(callee_arity)?;
} }
Drop => { Drop => {
+1 -1
View File
@@ -99,7 +99,7 @@ pub(crate) fn generate_thunks(
// Signature of the thunk should match the original function signature. // Signature of the thunk should match the original function signature.
.signature() .signature()
.with_params(thunk.signature.params().to_vec()) .with_params(thunk.signature.params().to_vec())
.with_return_type(thunk.signature.return_type()) .with_results(thunk.signature.results().to_vec())
.build() .build()
.body() .body()
.with_instructions(elements::Instructions::new( .with_instructions(elements::Instructions::new(