diff --git a/src/support/command-line.cpp b/src/support/command-line.cpp index d6b973b96d3..19c48cc9cba 100644 --- a/src/support/command-line.cpp +++ b/src/support/command-line.cpp @@ -172,12 +172,12 @@ Options& Options::add_positional(const std::string& name, void Options::parse(int argc, const char* argv[]) { #ifdef _WIN32 - auto argListW = CommandLineToArgvW(GetCommandLineW(), &argc); + LPWSTR* argListW = CommandLineToArgvW(GetCommandLineW(), &argc); std::vector argList; - std::cerr << "cmd line "; + //std::cerr << "cmd line "; for (size_t i = 0, e = argc; i < e; ++i) { argList.push_back(wasm::Path::wstring_to_string(argListW[i])); - std::cerr << argListW[i] << " " << argList[i] << "\n"; + //std::cerr << *argListW[i] << " " << argList[i] << "\n"; } #else const char** argList = argv; diff --git a/src/support/file.cpp b/src/support/file.cpp index 620551460e7..f1e0c9575c3 100644 --- a/src/support/file.cpp +++ b/src/support/file.cpp @@ -110,13 +110,13 @@ wasm::Output::Output(const std::string& filename, Flags::BinaryOption binary) buffer = std::cout.rdbuf(); } else { BYN_TRACE("Opening '" << filename << "'\n"); - auto flags = std::ofstream::out | std::ofstream::trunc; + std::ios_base::openmode flags = std::ofstream::out | std::ofstream::trunc; if (binary == Flags::Binary) { flags |= std::ofstream::binary; } outfile.open(wasm::Path::to_path(filename), flags); if (!outfile.is_open()) { - Fatal() << "Failed opening '" << filename << "'"; + Fatal() << "Failed opening output file '" << filename << "': " << strerror(errno); } buffer = outfile.rdbuf(); } diff --git a/src/wasm/wasm-io.cpp b/src/wasm/wasm-io.cpp index dde412aa36e..7522ae96148 100644 --- a/src/wasm/wasm-io.cpp +++ b/src/wasm/wasm-io.cpp @@ -163,7 +163,7 @@ void ModuleWriter::writeBinary(Module& wasm, Output& output) { sourceMapStream = std::make_unique(); sourceMapStream->open(wasm::Path::to_path(sourceMapFilename)); if (!sourceMapStream->is_open()) { - Fatal() << "Failed opening '" << sourceMapFilename << "'"; + Fatal() << "Failed opening sourcemap output file '" << sourceMapFilename << "'"; } writer.setSourceMap(sourceMapStream.get(), sourceMapUrl); } diff --git a/test/lit/unicode.wast b/test/lit/unicode.wast new file mode 100644 index 00000000000..bbb8692b821 --- /dev/null +++ b/test/lit/unicode.wast @@ -0,0 +1,13 @@ +;; RUN: wasm-as %s -o %t-❤.wasm + +(module + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (memory $0 256 256) + (export "add" (func $add)) + (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (local.get $0) + (local.get $1) + ) + ) +) \ No newline at end of file