Skip to content

Commit

Permalink
Fix memory.grow bound check take 3
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Nov 21, 2023
1 parent b84ed83 commit b1d7c09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/vm/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl MemoryInstance {

pub fn grow(&mut self, n: usize) -> Result<()> {
let len = self.page_count() + n;
if len > (i32::MAX as usize / WASM_PAGE_SIZE) {
if len > (u32::MAX as usize / WASM_PAGE_SIZE) {
return Err(Error::GrowOverMaximumPageSize(len));
}

Expand Down

0 comments on commit b1d7c09

Please sign in to comment.