mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
Fix emscripten table assertion panic
This commit is contained in:
@@ -33,13 +33,12 @@ pub fn is_emscripten_module(module: &Module) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn get_emscripten_table_size(module: &Module) -> (u32, Option<u32>) {
|
||||
assert!(
|
||||
module.info().imported_tables.len() > 0,
|
||||
"Emscripten requires at least one imported table"
|
||||
);
|
||||
pub fn get_emscripten_table_size(module: &Module) -> Result<(u32, Option<u32>), String> {
|
||||
if module.info().imported_tables.len() == 0 {
|
||||
return Err("Emscripten requires at least one imported table".to_string());
|
||||
}
|
||||
let (_, table) = &module.info().imported_tables[ImportedTableIndex::new(0)];
|
||||
(table.minimum, table.maximum)
|
||||
Ok((table.minimum, table.maximum))
|
||||
}
|
||||
|
||||
pub fn get_emscripten_memory_size(module: &Module) -> (Pages, Option<Pages>, bool) {
|
||||
|
||||
Reference in New Issue
Block a user