Skip to content

Commit d883009

Browse files
authored
Write wasm/wast files with BINARYEN_PASS_DEBUG=3 (#2527)
Currently `BINARYEN_PASS_DEBUG=3` prints `.wasm` files but they are actually text wast files. This makes `BINARYEN_PASS_DEBUG=3` prints both wasm/wast files, where wasm contains a binary file and wast a text file.
1 parent 321222a commit d883009

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/passes/pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,11 @@ static void dumpWast(Name name, Module* wasm) {
468468
// TODO: use _getpid() on windows, elsewhere?
469469
fullName += std::to_string(getpid()) + '-';
470470
#endif
471-
fullName += numstr + "-" + name.str + ".wasm";
471+
fullName += numstr + "-" + name.str;
472472
Colors::setEnabled(false);
473473
ModuleWriter writer;
474-
writer.setBinary(false); // TODO: add an option for binary
475-
writer.write(*wasm, fullName);
474+
writer.writeText(*wasm, fullName + ".wast");
475+
writer.writeBinary(*wasm, fullName + ".wasm");
476476
}
477477

478478
void PassRunner::run() {

0 commit comments

Comments
 (0)