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

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

Issue 2481173003: Version 5.6.231.1 (cherry-pick) (Closed)
Patch Set: Created 4 years, 1 month 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 | « include/v8-version.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index c81d2c8df2cd60f038d1c6853f6946491f7dab56..baa6b7b41b0d9bc0b9dd3baa1a004c7cc169f00c 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2168,7 +2168,15 @@ Node* WasmGraphBuilder::CallIndirect(uint32_t sig_index, Node** args,
uint32_t table_index = 0;
wasm::FunctionSig* sig = module_->GetSignature(sig_index);
- DCHECK(module_->IsValidTable(table_index));
+ if (!module_->IsValidTable(table_index)) {
+ // No function table. Generate a trap and return a constant.
+ trap_->AddTrapIfFalse(wasm::kTrapFuncInvalid, Int32Constant(0), position);
+ (*rets) = Buffer(sig->return_count());
+ for (size_t i = 0; i < sig->return_count(); i++) {
+ (*rets)[i] = trap_->GetTrapValue(sig->GetReturn(i));
+ }
+ return trap_->GetTrapValue(sig);
+ }
EnsureFunctionTableNodes();
MachineOperatorBuilder* machine = jsgraph()->machine();
« no previous file with comments | « include/v8-version.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698