Upgrade wasmparser to 0.58.0 (#1942)
* Upgrade wasmparser to 0.58.0 * Enable more spec tests
This commit is contained in:
@@ -24,7 +24,7 @@ smallvec = "1.0.0"
|
||||
staticvec = "0.10"
|
||||
thiserror = "1.0.9"
|
||||
typemap = "0.3"
|
||||
wasmparser = "0.57.0"
|
||||
wasmparser = "0.58.0"
|
||||
|
||||
[dev-dependencies]
|
||||
lazy_static = "1.2"
|
||||
|
||||
@@ -5,14 +5,18 @@ use cranelift_codegen::{binemit, ir};
|
||||
use wasmparser::{
|
||||
CodeSectionReader, DataSectionReader, ElementSectionReader, ExportSectionReader, FuncType,
|
||||
FunctionSectionReader, GlobalSectionReader, ImportSectionReader, MemorySectionReader,
|
||||
MemoryType, TableSectionReader, TableType, TypeSectionReader,
|
||||
MemoryType, TableSectionReader, TableType, TypeDef, TypeSectionReader,
|
||||
};
|
||||
|
||||
/// Parses the Type section of the wasm module.
|
||||
pub fn type_(types_reader: TypeSectionReader) -> Result<Vec<FuncType>, Error> {
|
||||
types_reader
|
||||
.into_iter()
|
||||
.map(|r| r.map_err(Into::into))
|
||||
.map(|r| match r {
|
||||
Ok(TypeDef::Func(ft)) => Ok(ft),
|
||||
Ok(_) => unimplemented!("module linking is not implemented yet"),
|
||||
Err(e) => Err(e.into()),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user