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

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

Issue 2484623002: [wasm] Indirect calls without function table cause validation errors. (Closed)
Patch Set: try to export symbols 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 | « src/compiler/wasm-compiler.cc ('k') | src/wasm/signature-map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index ea7ddcf52813b5f2b6dcdfd0c2a56403b3ab7c13..a2d0a3f0dea04fc42bdb79dda0fadcd0588ca982 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -227,6 +227,11 @@ class WasmDecoder : public Decoder {
}
inline bool Validate(const byte* pc, CallIndirectOperand& operand) {
+ uint32_t table_index = 0;
+ if (!module_->IsValidTable(table_index)) {
+ error("function table has to exist to execute call_indirect");
+ return false;
+ }
if (Complete(pc, operand)) {
return true;
}
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/signature-map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698