From 802dd8ff76d423f438c1d69dd5da6c47bb762c88 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Dec 2018 13:17:52 -0800 Subject: Don't error on too many locals - just oom (#1822) I think I added this error for fuzzing, but it is harmful as it prevents a module with too many locals from being loaded - if we could load it, we might be able to optimize it to have fewer locals... --- src/wasm/wasm-binary.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index c1cb02375..2a7bff51f 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1081,14 +1081,6 @@ void WasmBinaryBuilder::readFunctions() { for (size_t t = 0; t < numLocalTypes; t++) { auto num = getU32LEB(); auto type = getConcreteType(); - if (num > WebLimitations::MaxFunctionLocals) { - // In general for Web limitations we try to just warn, but not actually - // enforce the limit ourselves (as we may be looking at wasm not intended - // to run on the Web). However, too many locals will simply cause us to - // OOM, so some arbitrary limit makes sense - and if so, why not use - // the arbitrary Web limit, for consistency. - throwError("too many locals, wasm VMs would not accept this binary"); - } while (num > 0) { func->vars.push_back(type); num--; -- cgit v1.2.3