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

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

Issue 2403093002: [wasm] Canonicalize function signature indices for matching in indirect calls. (Closed)
Patch Set: Address review comments 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/wasm-module.h ('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 f215f851762bd40bcf8538b9ac5a54c1c8059172..3a4ac2dbef552e48cb2562ed785b3c3120a403b5 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2059,7 +2059,9 @@ Handle<FixedArray> BuildFunctionTable(Isolate* isolate, uint32_t index,
isolate->factory()->NewFixedArray(2 * table->max_size, TENURED);
for (uint32_t i = 0; i < table->size; ++i) {
const WasmFunction* function = &module->functions[table->values[i]];
- values->set(i, Smi::FromInt(function->sig_index));
+ int32_t index = table->map.Find(function->sig);
+ DCHECK_GE(index, 0);
+ values->set(i, Smi::FromInt(index));
values->set(i + table->max_size, Smi::FromInt(table->values[i]));
}
// Set the remaining elements to -1 (instead of "undefined"). These
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-module-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698