mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-22 11:11:54 +00:00
Reorganize
This commit is contained in:
@ -1,15 +1,11 @@
|
|||||||
|
#![allow(unused, missing_docs)]
|
||||||
|
|
||||||
use elements::{Module, ResizableLimits, MemoryType, TableType};
|
use elements::{Module, ResizableLimits, MemoryType, TableType};
|
||||||
|
|
||||||
pub struct Error(pub String);
|
pub struct Error(pub String);
|
||||||
|
|
||||||
pub fn validate_module(module: &Module) -> Result<(), Error> {
|
pub fn validate_module(module: &Module) -> Result<(), Error> {
|
||||||
if let Some(mem_section) = module.memory_section() {
|
// TODO: Functions
|
||||||
mem_section
|
|
||||||
.entries()
|
|
||||||
.iter()
|
|
||||||
.map(MemoryType::validate)
|
|
||||||
.collect::<Result<_, _>>()?
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(table_section) = module.table_section() {
|
if let Some(table_section) = module.table_section() {
|
||||||
table_section
|
table_section
|
||||||
@ -19,6 +15,14 @@ pub fn validate_module(module: &Module) -> Result<(), Error> {
|
|||||||
.collect::<Result<_, _>>()?
|
.collect::<Result<_, _>>()?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(mem_section) = module.memory_section() {
|
||||||
|
mem_section
|
||||||
|
.entries()
|
||||||
|
.iter()
|
||||||
|
.map(MemoryType::validate)
|
||||||
|
.collect::<Result<_, _>>()?
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user