Skip to content

Commit 56cdbdd

Browse files
authored
Increase the maximum type size to 1M (#945)
In #940 there are modules in the wild running into the previous 100k limit. This previous limit was completely arbitrarily chosen, so increase it by 10x and see how things go. In theory 1M should still be reasonable enough to typecheck in a modest amount of time for input modules while still preventing excessive use of resources during fuzzing.
1 parent c892013 commit 56cdbdd

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

crates/wasmparser/src/limits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub const MAX_WASM_INSTANTIATION_EXPORTS: usize = 1000;
5050
pub const MAX_WASM_CANONICAL_OPTIONS: usize = 10;
5151
pub const MAX_WASM_INSTANTIATION_ARGS: usize = 1000;
5252
pub const MAX_WASM_START_ARGS: usize = 1000;
53-
pub const MAX_WASM_TYPE_SIZE: u32 = 100_000;
53+
pub const MAX_WASM_TYPE_SIZE: u32 = 1_000_000;
5454
pub const MAX_WASM_MODULES: usize = 1_000;
5555
pub const MAX_WASM_COMPONENTS: usize = 1_000;
5656
pub const MAX_WASM_INSTANCES: usize = 1_000;

tests/local/component-model/very-nested.wast

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,17 +1836,31 @@
18361836
(field "f9" $t3)
18371837
))
18381838

1839+
;; size(t5) == 100000
1840+
(type $t5 (record
1841+
(field "f0" $t4)
1842+
(field "f1" $t4)
1843+
(field "f2" $t4)
1844+
(field "f3" $t4)
1845+
(field "f4" $t4)
1846+
(field "f5" $t4)
1847+
(field "f6" $t4)
1848+
(field "f7" $t4)
1849+
(field "f8" $t4)
1850+
(field "f9" $t4)
1851+
))
1852+
18391853
(type $f (func
1840-
(param "a" $t4)
1841-
(param "b" $t4)
1842-
(param "c" $t4)
1843-
(param "d" $t4)
1844-
(param "e" $t4)
1845-
(param "f" $t4)
1846-
(param "g" $t4)
1847-
(param "h" $t4)
1848-
(param "i" $t4)
1849-
(param "j" $t4)
1854+
(param "a" $t5)
1855+
(param "b" $t5)
1856+
(param "c" $t5)
1857+
(param "d" $t5)
1858+
(param "e" $t5)
1859+
(param "f" $t5)
1860+
(param "g" $t5)
1861+
(param "h" $t5)
1862+
(param "i" $t5)
1863+
(param "j" $t5)
18501864
))
18511865
)
18521866
"effective type size exceeds the limit")

0 commit comments

Comments
 (0)