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

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

Issue 2733743002: [wasm][asm.js] Asm.js -> wasm custom parser. (Closed)
Patch Set: fix Created 3 years, 9 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 | « src/v8.gyp ('k') | src/wasm/wasm-module-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index dbacfb85dc1cd9446ff1b0075eee9c1d9aa45e27..fd5fe2622c46cb48a8ade7de9be15e28420468d2 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1669,6 +1669,13 @@ class InstantiationHelper {
module_name, import_name);
return -1;
}
+ if (FLAG_fast_validate_asm) {
+ if (module_->globals[import.index].type == kWasmI32) {
+ value = Object::ToInt32(isolate_, value).ToHandleChecked();
+ } else {
+ value = Object::ToNumber(value).ToHandleChecked();
+ }
+ }
if (!value->IsNumber()) {
ReportLinkError("global import must be a number", index,
module_name, import_name);
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-module-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698