2019-12-17 15:12:54 -08:00
|
|
|
use wasmer_runtime_core::parse::wp_type_to_type;
|
2019-05-06 23:41:31 -05:00
|
|
|
use wasmer_runtime_core::types::Type;
|
2019-12-17 15:12:54 -08:00
|
|
|
use wasmparser::{BinaryReaderError, TypeOrFuncType as WpTypeOrFuncType};
|
2019-07-01 16:11:38 -07:00
|
|
|
|
|
|
|
pub fn blocktype_to_type(ty: WpTypeOrFuncType) -> Result<Type, BinaryReaderError> {
|
|
|
|
match ty {
|
2019-12-17 15:12:54 -08:00
|
|
|
WpTypeOrFuncType::Type(inner_ty) => wp_type_to_type(inner_ty),
|
2019-07-01 16:11:38 -07:00
|
|
|
_ => {
|
|
|
|
return Err(BinaryReaderError {
|
2019-07-01 16:15:13 -07:00
|
|
|
message:
|
|
|
|
"the wasmer llvm backend does not yet support the multi-value return extension",
|
2019-07-01 16:11:38 -07:00
|
|
|
offset: -1isize as usize,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|