Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4069)

Unified Diff: src/wasm/wasm-js.cc

Issue 1940243002: [wasm] Fix bug with empty input to Wasm.instantiateModuleFromAsm() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-605488.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 833c39902559e4d86bea1a1b82e27282d6a97b6e..0992031e45a07aa5f65a422709a85b0ce28f2c8b 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -134,6 +134,11 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(
return nullptr;
}
+ if (info->scope()->declarations()->length() == 0) {
+ thrower->Error("Asm.js validation failed: no declarations in scope");
+ return nullptr;
+ }
+
info->set_literal(
info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun());
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-605488.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698