summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/wat2wasm.cc5
-rw-r--r--test/regress/regress-24.txt7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/tools/wat2wasm.cc b/src/tools/wat2wasm.cc
index d2f2185d..fe41d49f 100644
--- a/src/tools/wat2wasm.cc
+++ b/src/tools/wat2wasm.cc
@@ -102,11 +102,12 @@ static void ParseOptions(int argc, char* argv[]) {
static void WriteBufferToFile(string_view filename,
const OutputBuffer& buffer) {
if (s_dump_module) {
+ std::unique_ptr<FileStream> stream = FileStream::CreateStdout();
if (s_verbose) {
- s_log_stream->Writef(";; dump\n");
+ stream->Writef(";; dump\n");
}
if (!buffer.data.empty()) {
- s_log_stream->WriteMemoryDump(buffer.data.data(), buffer.data.size());
+ stream->WriteMemoryDump(buffer.data.data(), buffer.data.size());
}
}
diff --git a/test/regress/regress-24.txt b/test/regress/regress-24.txt
new file mode 100644
index 00000000..56edfb7d
--- /dev/null
+++ b/test/regress/regress-24.txt
@@ -0,0 +1,7 @@
+;;; TOOL: wat2wasm
+;;; ARGS: -d
+(module (func (export "fn")))
+(;; STDOUT ;;;
+0000000: 0061 736d 0100 0000 0104 0160 0000 0302
+0000010: 0100 0706 0102 666e 0000 0a04 0102 000b
+;;; STDOUT ;;)