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

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

Issue 1608743006: [wasm] Verify boundaries of data segments when decoding modules. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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-opcodes.h ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-opcodes.cc
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc
index 25eef034d7f3e7b86d6d9c78d52b14fdc83c38c9..a609e032611ce8633ee5c148882dfb0df9503e50 100644
--- a/src/wasm/wasm-opcodes.cc
+++ b/src/wasm/wasm-opcodes.cc
@@ -25,6 +25,20 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
}
+std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) {
+ if (sig.return_count() == 0) os << "v";
+ for (size_t i = 0; i < sig.return_count(); i++) {
+ os << WasmOpcodes::ShortNameOf(sig.GetReturn(i));
+ }
+ os << "_";
+ if (sig.parameter_count() == 0) os << "v";
+ for (size_t i = 0; i < sig.parameter_count(); i++) {
+ os << WasmOpcodes::ShortNameOf(sig.GetParam(i));
+ }
+ return os;
+}
+
+
#define DECLARE_SIG_ENUM(name, ...) kSigEnum_##name,
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698