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

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

Issue 2403093002: [wasm] Canonicalize function signature indices for matching in indirect calls. (Closed)
Patch Set: Add TODO for myself 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
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 4d5dc7e7ddcd5c1e5c0531da0ca5d71324dfd0f5..a3b449a02364808388f7b1bb3de9ca228f87b9b9 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2049,7 +2049,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

Powered by Google App Engine
This is Rietveld 408576698