Skip to content

Commit b2227ae

Browse files
authored
ensure table max size is a least as big as the initial size (#70)
1 parent 3d36244 commit b2227ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/loader/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,8 @@ pub fn load_wasm<'a, S: Settings<'a>>(
955955
.ty
956956
.maximum
957957
.map(|v| v as u32)
958-
.unwrap_or(DEFAULT_MAX_TABLE_SIZE);
958+
// ensure table max size is a least as big as the initial size
959+
.unwrap_or(DEFAULT_MAX_TABLE_SIZE.max(table.ty.initial as u32));
959960

960961
// We include two extra words for the table size and maximum size
961962
let segment = mem_allocator

0 commit comments

Comments
 (0)