Make tests happy again

This commit is contained in:
Syrus Akbary
2018-11-29 20:49:34 -08:00
parent 55b0509654
commit 948f519a04
2 changed files with 16 additions and 8 deletions

View File

@ -463,9 +463,17 @@ impl Instance {
// Get memories in module
for memory in &module.info.memories {
let memory = memory.entity;
let v =
LinearMemory::new(memory.pages_count as u32, memory.maximum.map(|m| m as u32));
memories.push(v);
// If we use emscripten, we set a fixed initial and maximum
debug!("Instance - init memory ({}, {:?})", memory.pages_count, memory.maximum);
let memory = if options.use_emscripten {
// We use MAX_PAGES, so at the end the result is:
// (initial * LinearMemory::PAGE_SIZE) == LinearMemory::DEFAULT_HEAP_SIZE
LinearMemory::new(LinearMemory::MAX_PAGES as u32, None)
}
else {
LinearMemory::new(memory.pages_count as u32, memory.maximum.map(|m| m as u32))
};
memories.push(memory);
}
for init in &module.info.data_initializers {