mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 14:41:32 +00:00
Update for new wasmparser.rs version.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use wasmer_runtime_core::types::Type;
|
||||
use wasmparser::{BinaryReaderError, Type as WpType};
|
||||
use wasmparser::{BinaryReaderError, Type as WpType, TypeOrFuncType as WpTypeOrFuncType};
|
||||
|
||||
pub fn type_to_type(ty: WpType) -> Result<Type, BinaryReaderError> {
|
||||
Ok(match ty {
|
||||
@ -21,3 +21,15 @@ pub fn type_to_type(ty: WpType) -> Result<Type, BinaryReaderError> {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn blocktype_to_type(ty: WpTypeOrFuncType) -> Result<Type, BinaryReaderError> {
|
||||
match ty {
|
||||
WpTypeOrFuncType::Type(inner_ty) => { type_to_type(inner_ty) }
|
||||
_ => {
|
||||
return Err(BinaryReaderError {
|
||||
message: "the wasmer llvm backend does not yet support the multi-value return extension",
|
||||
offset: -1isize as usize,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user