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