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

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

Issue 2049513003: [wasm] Support undefined indirect table entries, behind a flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix formatting Created 4 years, 6 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
Index: src/wasm/module-decoder.cc
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc
index 8ea4802ef40ea8baf81c966314582cae47d6b8d4..2ac2f9eafaad2e848dcb102d5c671cc0a1fdc551 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -270,6 +270,20 @@ class ModuleDecoder : public Decoder {
}
break;
}
+ case WasmSection::Code::FunctionTablePad: {
+ if (!FLAG_wasm_jit_prototype) {
+ error("FunctionTablePad section without jiting enabled");
+ }
+ // An indirect function table requires functions first.
+ int length;
Mircea Trofin 2016/06/21 19:46:14 please initialize length.
+ module->indirect_table_size =
+ consume_u32v(&length, "indirect entry count");
+ if (module->indirect_table_size > 0 &&
+ module->indirect_table_size < module->function_table.size()) {
+ error("more predefined indirect entries than table can hold");
+ }
+ break;
+ }
case WasmSection::Code::FunctionTable: {
// An indirect function table requires functions first.
CheckForFunctions(module, section);
@@ -289,6 +303,10 @@ class ModuleDecoder : public Decoder {
}
module->function_table.push_back(index);
}
+ if (module->indirect_table_size > 0 &&
+ module->indirect_table_size < module->function_table.size()) {
+ error("more predefined indirect entries than table can hold");
+ }
break;
}
case WasmSection::Code::StartFunction: {
« no previous file with comments | « src/flag-definitions.h ('k') | src/wasm/wasm-module.h » ('j') | src/wasm/wasm-module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698