mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-19 20:01:20 +00:00
fix 653 panic in memoryDescriptor
This commit is contained in:
@ -136,11 +136,13 @@ pub fn read_module<
|
||||
.push((import_name, table_desc));
|
||||
}
|
||||
ImportSectionEntryType::Memory(memory_ty) => {
|
||||
let mem_desc = MemoryDescriptor {
|
||||
minimum: Pages(memory_ty.limits.initial),
|
||||
maximum: memory_ty.limits.maximum.map(|max| Pages(max)),
|
||||
shared: memory_ty.shared,
|
||||
};
|
||||
let mem_desc = MemoryDescriptor::new(
|
||||
Pages(memory_ty.limits.initial),
|
||||
memory_ty.limits.maximum.map(|max| Pages(max)),
|
||||
memory_ty.shared,
|
||||
)
|
||||
.map_err(|x| LoadError::Codegen(format!("{:?}", x)))?;
|
||||
|
||||
info.write()
|
||||
.unwrap()
|
||||
.imported_memories
|
||||
@ -172,11 +174,12 @@ pub fn read_module<
|
||||
info.write().unwrap().tables.push(table_desc);
|
||||
}
|
||||
ParserState::MemorySectionEntry(memory_ty) => {
|
||||
let mem_desc = MemoryDescriptor {
|
||||
minimum: Pages(memory_ty.limits.initial),
|
||||
maximum: memory_ty.limits.maximum.map(|max| Pages(max)),
|
||||
shared: memory_ty.shared,
|
||||
};
|
||||
let mem_desc = MemoryDescriptor::new(
|
||||
Pages(memory_ty.limits.initial),
|
||||
memory_ty.limits.maximum.map(|max| Pages(max)),
|
||||
memory_ty.shared,
|
||||
)
|
||||
.map_err(|x| LoadError::Codegen(format!("{:?}", x)))?;
|
||||
|
||||
info.write().unwrap().memories.push(mem_desc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user