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

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

Issue 2433313002: [wasm] Only use the table maximum in allocation if it is non-zero. (Closed)
Patch Set: Created 4 years, 2 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/wasm/module-decoder.cc ('k') | no next file » | 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 dc34d52d21279c6ed565ffa828d5982f0d99e236..e789982ba8b58b75f469cab1f7d1dd7d11a849d7 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1042,7 +1042,7 @@ class WasmInstanceBuilder {
factory->NewFixedArray(function_table_count);
for (int index = 0; index < function_table_count; ++index) {
WasmIndirectFunctionTable& table = module_->function_tables[index];
- uint32_t size = table.max_size;
+ uint32_t size = table.max_size > 0 ? table.max_size : table.size;
ahaas 2016/10/20 09:09:42 Could we just set the default value of table.max_s
Handle<FixedArray> new_table = factory->NewFixedArray(size * 2);
for (int i = 0; i < new_table->length(); ++i) {
static const int kInvalidSigIndex = -1;
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698