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

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

Issue 2520853003: [wasm] Add a flag to generate an mjsunit test out of a wasm-code fuzzer test case. (Closed)
Patch Set: rename wasm-code-generate-test to wasm-code-fuzzer-gen-test 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/flag-definitions.h ('k') | test/fuzzer/wasm-code.cc » ('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 13aaba1e85319524d851dccd597dd685817d0d25..a869206e5be5f49aa7e95b6cb50bafa0ba67d15c 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -381,6 +381,9 @@ class WasmFullDecoder : public WasmDecoder {
}
bool Decode() {
+ if (FLAG_wasm_code_fuzzer_gen_test) {
+ PrintAstForDebugging(start_, end_);
+ }
base::ElapsedTimer decode_timer;
if (FLAG_trace_wasm_decode_time) {
decode_timer.Start();
@@ -1928,7 +1931,7 @@ bool PrintAst(AccountingAllocator* allocator, const FunctionBody& body,
// Print the local declarations.
AstLocalDecls decls(&zone);
BytecodeIterator i(body.start, body.end, &decls);
- if (body.start != i.pc()) {
+ if (body.start != i.pc() && !FLAG_wasm_code_fuzzer_gen_test) {
os << "// locals: ";
for (auto p : decls.local_types) {
LocalType type = p.first;
« no previous file with comments | « src/flag-definitions.h ('k') | test/fuzzer/wasm-code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698