mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-28 23:21:35 +00:00
Add checks for tables and memories count.
This commit is contained in:
parent
991fb8fcd8
commit
8afb7b6450
@ -99,6 +99,17 @@ pub fn validate_module(module: &Module) -> Result<ValidatedModule, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// there must be no greater than 1 table in tables index space
|
||||
if context.tables().len() > 1 {
|
||||
return Err(Error(format!("too many tables in index space: {}", context.tables().len())));
|
||||
}
|
||||
|
||||
// there must be no greater than 1 linear memory in memory index space
|
||||
if context.memories().len() > 1 {
|
||||
return Err(Error(format!("too many memory regions in index space: {}", context.memories().len())));
|
||||
}
|
||||
|
||||
let ModuleContext {
|
||||
types,
|
||||
tables,
|
||||
|
Loading…
x
Reference in New Issue
Block a user