mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-04-25 07:12:15 +00:00
fix signature return types amount specification
This commit is contained in:
parent
42c60e9154
commit
0a61083238
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "parity-wasm"
|
||||
version = "0.27.4"
|
||||
version = "0.27.5"
|
||||
authors = ["Nikolay Volf <nikvolf@gmail.com>", "Svyatoslav Nikolsky <svyatonik@yandex.ru>", "Sergey Shulepov <s.pepyakin@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
BIN
res/cases/v1/err-return-type.wasm
Normal file
BIN
res/cases/v1/err-return-type.wasm
Normal file
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
use std::{io, fmt};
|
||||
use super::{
|
||||
Deserialize, Serialize, Error, VarUint7, VarInt7, VarUint1, CountedList,
|
||||
CountedListWriter
|
||||
CountedListWriter, VarUint32,
|
||||
};
|
||||
|
||||
/// Type definition in types section. Currently can be only of the function type.
|
||||
@ -177,11 +177,14 @@ impl Deserialize for FunctionType {
|
||||
|
||||
let params: Vec<ValueType> = CountedList::deserialize(reader)?.into_inner();
|
||||
|
||||
let has_return_type = VarUint1::deserialize(reader)?;
|
||||
let return_type = if has_return_type.into() {
|
||||
let return_types: u32 = VarUint32::deserialize(reader)?.into();
|
||||
|
||||
let return_type = if return_types == 1 {
|
||||
Some(ValueType::deserialize(reader)?)
|
||||
} else {
|
||||
} else if return_types == 0 {
|
||||
None
|
||||
} else {
|
||||
return Err(Error::Other("Return types length should be 0 or 1"));
|
||||
};
|
||||
|
||||
Ok(FunctionType {
|
||||
|
Loading…
x
Reference in New Issue
Block a user