Move offset_guard_size to the memory style

This commit is contained in:
Syrus
2020-07-07 15:58:46 -07:00
parent 98f2e8fe26
commit 416b76ab34
5 changed files with 36 additions and 21 deletions

View File

@@ -644,8 +644,9 @@ impl<'module_environment> BaseFuncEnvironment for FuncEnvironment<'module_enviro
// allocated up front and never moved.
let (offset_guard_size, heap_style, readonly_base) = match self.memory_plans[index] {
MemoryPlan {
style: MemoryStyle::Dynamic,
offset_guard_size,
style: MemoryStyle::Dynamic {
offset_guard_size
},
memory: _,
} => {
let heap_bound = func.create_global_value(ir::GlobalValueData::Load {
@@ -663,8 +664,7 @@ impl<'module_environment> BaseFuncEnvironment for FuncEnvironment<'module_enviro
)
}
MemoryPlan {
style: MemoryStyle::Static { bound },
offset_guard_size,
style: MemoryStyle::Static { bound, offset_guard_size },
memory: _,
} => (
Uimm64::new(offset_guard_size),