Skip to content

Commit

Permalink
Fix memory size in opaque-only case
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Sep 24, 2023
1 parent dc589f3 commit 417ca1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ pub fn compile<'a, O: Hash + Eq, T: Refs<'a, Opaque = O>>(f: Node<'a, O, T>) ->

let mut memory_section = MemorySection::new();
let page_size = 65536;
let pages: u64 = ((costs.last().unwrap() + page_size - 1) / page_size).into();
let pages: u64 = ((costs.last().unwrap_or(&0) + page_size - 1) / page_size).into();
memory_section.memory(MemoryType {
minimum: pages,
maximum: Some(pages),
Expand Down

0 comments on commit 417ca1b

Please sign in to comment.