wasmer/lib/llvm-backend/src/read_info.rs

17 lines
591 B
Rust
Raw Normal View History

use wasmer_runtime_core::parse::wp_type_to_type;
2019-05-06 23:41:31 -05:00
use wasmer_runtime_core::types::Type;
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 {
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,
});
}
}
}