diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-09-22 16:26:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 14:26:11 -0700 |
commit | b1ba25732c1a02ae3da726c4b01ca3825ef969ef (patch) | |
tree | f3d6368fabea900d1a4dfa0671dba7df74414e0f | |
parent | 27d0c232bb1d6e4f2cb22fbe8511829730457dbd (diff) | |
download | binaryen-b1ba25732c1a02ae3da726c4b01ca3825ef969ef.tar.gz binaryen-b1ba25732c1a02ae3da726c4b01ca3825ef969ef.tar.bz2 binaryen-b1ba25732c1a02ae3da726c4b01ca3825ef969ef.zip |
Correctly handle escapes in string constants (#5070)
Previously when we parsed `string.const` payloads in the text format we were
using the text strings directly instead of un-escaping them. Fix that parsing,
and while we're editing the code, also add support for the `\r` escape allowed
by the spec. Remove a spurious nested anonymous namespace and spurious `static`s
in Print.cpp as well.
-rw-r--r-- | src/passes/Print.cpp | 106 | ||||
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 34 | ||||
-rw-r--r-- | test/lit/passes/O4_disable-bulk-memory.wast | 2 | ||||
-rw-r--r-- | test/lit/strings.wast | 4 | ||||
-rw-r--r-- | test/lld/em_js_O0.wat.out | 2 | ||||
-rw-r--r-- | test/passes/converge_O3_metrics.bin.txt | 6 |
6 files changed, 81 insertions, 73 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index dc247c737..d1e08e0ec 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -67,7 +67,7 @@ std::ostream& printMemoryName(Name name, std::ostream& o, Module* wasm) { return o; } -static std::ostream& printLocal(Index index, Function* func, std::ostream& o) { +std::ostream& printLocal(Index index, Function* func, std::ostream& o) { Name name; if (func) { name = func->getLocalNameOrDefault(index); @@ -78,9 +78,7 @@ static std::ostream& printLocal(Index index, Function* func, std::ostream& o) { return printName(name, o); } -namespace { - -static bool maybePrintRefShorthand(std::ostream& o, Type type) { +bool maybePrintRefShorthand(std::ostream& o, Type type) { if (!type.isRef()) { return false; } @@ -292,9 +290,7 @@ void TypeNamePrinter::print(const Array& array) { os << ']'; } -} // anonymous namespace - -static std::ostream& printType(std::ostream& o, Type type, Module* wasm) { +std::ostream& printType(std::ostream& o, Type type, Module* wasm) { if (type.isBasic()) { o << type; } else if (type.isTuple()) { @@ -321,16 +317,15 @@ static std::ostream& printType(std::ostream& o, Type type, Module* wasm) { return o; } -static std::ostream& -printHeapType(std::ostream& o, HeapType type, Module* wasm) { +std::ostream& printHeapType(std::ostream& o, HeapType type, Module* wasm) { TypeNamePrinter(o, wasm).print(type); return o; } -static std::ostream& printPrefixedTypes(std::ostream& o, - const char* prefix, - Type type, - Module* wasm) { +std::ostream& printPrefixedTypes(std::ostream& o, + const char* prefix, + Type type, + Module* wasm) { o << '(' << prefix; if (type == Type::none) { return o << ')'; @@ -350,11 +345,11 @@ static std::ostream& printPrefixedTypes(std::ostream& o, return o; } -static std::ostream& printResultType(std::ostream& o, Type type, Module* wasm) { +std::ostream& printResultType(std::ostream& o, Type type, Module* wasm) { return printPrefixedTypes(o, "result", type, wasm); } -static std::ostream& printParamType(std::ostream& o, Type type, Module* wasm) { +std::ostream& printParamType(std::ostream& o, Type type, Module* wasm) { return printPrefixedTypes(o, "param", type, wasm); } @@ -379,6 +374,42 @@ void processFieldName(Module* wasm, HeapType type, Index index, T func) { func(Name()); } +std::ostream& +printEscapedString(std::ostream& os, const char* data, size_t len) { + os << '"'; + for (size_t i = 0; i < len; i++) { + unsigned char c = data[i]; + switch (c) { + case '\t': + os << "\\t"; + break; + case '\n': + os << "\\n"; + break; + case '\r': + os << "\\r"; + break; + case '"': + os << "\\\""; + break; + case '\'': + os << "\\'"; + break; + case '\\': + os << "\\\\"; + break; + default: { + if (c >= 32 && c < 127) { + os << c; + } else { + os << std::hex << '\\' << (c / 16) << (c % 16) << std::dec; + } + } + } + } + return os << '"'; +} + } // anonymous namespace // Printing "unreachable" as a instruction prefix type is not valid in wasm text @@ -2255,9 +2286,8 @@ struct PrintExpressionContents } } void visitStringConst(StringConst* curr) { - printMedium(o, "string.const \""); - o << curr->string.str; - o << '"'; + printMedium(o, "string.const "); + printEscapedString(o, curr->string.c_str(), curr->string.size()); } void visitStringMeasure(StringMeasure* curr) { switch (curr->op) { @@ -3171,44 +3201,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { visit(curr->offset); o << ' '; } - o << "\""; - for (size_t i = 0; i < curr->data.size(); i++) { - unsigned char c = curr->data[i]; - switch (c) { - case '\n': - o << "\\n"; - break; - case '\r': - o << "\\0d"; - break; - case '\t': - o << "\\t"; - break; - case '\f': - o << "\\0c"; - break; - case '\b': - o << "\\08"; - break; - case '\\': - o << "\\\\"; - break; - case '"': - o << "\\\""; - break; - case '\'': - o << "\\'"; - break; - default: { - if (c >= 32 && c < 127) { - o << c; - } else { - o << std::hex << '\\' << (c / 16) << (c % 16) << std::dec; - } - } - } - } - o << "\")" << maybeNewLine; + printEscapedString(o, curr->data.data(), curr->data.size()); + o << ')' << maybeNewLine; } void printDylinkSection(const std::unique_ptr<DylinkSection>& dylinkSection) { doIndent(o, indent) << ";; dylink section\n"; diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index d48e48585..ef41dec93 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -3049,7 +3049,17 @@ Expression* SExpressionWasmBuilder::makeStringNew(Element& s, StringNewOp op) { } Expression* SExpressionWasmBuilder::makeStringConst(Element& s) { - return Builder(wasm).makeStringConst(s[1]->str()); + Name rawStr = s[1]->str(); + size_t len = rawStr.size(); + std::vector<char> data; + stringToBinary(rawStr.c_str(), len, data); + data.push_back('\0'); + Name str = data.empty() ? "" : &data[0]; + if (str.size() != data.size() - 1) { + throw ParseException( + "zero bytes not yet supported in string constants", s.line, s.col); + } + return Builder(wasm).makeStringConst(str); } Expression* SExpressionWasmBuilder::makeStringMeasure(Element& s, @@ -3157,7 +3167,19 @@ void SExpressionWasmBuilder::stringToBinary(const char* input, break; } if (input[0] == '\\') { - if (input[1] == '"') { + if (input[1] == 't') { + *write++ = '\t'; + input += 2; + continue; + } else if (input[1] == 'n') { + *write++ = '\n'; + input += 2; + continue; + } else if (input[1] == 'r') { + *write++ = '\r'; + input += 2; + continue; + } else if (input[1] == '"') { *write++ = '"'; input += 2; continue; @@ -3169,14 +3191,6 @@ void SExpressionWasmBuilder::stringToBinary(const char* input, *write++ = '\\'; input += 2; continue; - } else if (input[1] == 'n') { - *write++ = '\n'; - input += 2; - continue; - } else if (input[1] == 't') { - *write++ = '\t'; - input += 2; - continue; } else { *write++ = (char)(unhex(input[1]) * 16 + unhex(input[2])); input += 3; diff --git a/test/lit/passes/O4_disable-bulk-memory.wast b/test/lit/passes/O4_disable-bulk-memory.wast index c0bcc07a9..c806bf867 100644 --- a/test/lit/passes/O4_disable-bulk-memory.wast +++ b/test/lit/passes/O4_disable-bulk-memory.wast @@ -64,7 +64,7 @@ ;; CHECK: (global $global$5 (mut i32) (i32.const 0)) - ;; CHECK: (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + ;; CHECK: (data (i32.const 8) "\r\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") ;; CHECK: (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") diff --git a/test/lit/strings.wast b/test/lit/strings.wast index 636a8a8b8..c950e914b 100644 --- a/test/lit/strings.wast +++ b/test/lit/strings.wast @@ -31,8 +31,8 @@ ;; CHECK: (type $stringref_ref|$array|_ref|$array16|_=>_none (func (param stringref (ref $array) (ref $array16)))) - ;; CHECK: (global $string-const stringref (string.const "string in a global")) - (global $string-const stringref (string.const "string in a global")) + ;; CHECK: (global $string-const stringref (string.const "string in a global \01\ff\t\t\n\n\r\r\"\"\'\'\\\\")) + (global $string-const stringref (string.const "string in a global \01\ff\t\09\n\0a\r\0d\"\22\'\27\\\5c")) ;; CHECK: (memory $0 10 10) diff --git a/test/lld/em_js_O0.wat.out b/test/lld/em_js_O0.wat.out index bda4f1b52..c4ddab7ba 100644 --- a/test/lld/em_js_O0.wat.out +++ b/test/lld/em_js_O0.wat.out @@ -4,7 +4,7 @@ (global $global$0 (mut i32) (i32.const 5250112)) (global $global$1 i32 (i32.const 5250112)) (global $global$2 i32 (i32.const 7232)) - (data (i32.const 1024) "(void)<::>{ out(\"no args works\"); }\00(void)<::>{ out(\"no args returning int\"); return 12; }\00(void)<::>{ out(\"no args returning double\"); return 12.25; }\00(int x)<::>{ out(\" takes ints: \" + x);}\00(double d)<::>{ out(\" takes doubles: \" + d);}\00(char* str)<::>{ out(\" takes strings: \" + UTF8ToString(str)); return 7.75; }\00(int x, int y)<::>{ out(\" takes multiple ints: \" + x + \", \" + y); return 6; }\00(int x, const char* str, double d)<::>{ out(\" mixed arg types: \" + x + \", \" + UTF8ToString(str) + \", \" + d); return 8.125; }\00(int unused)<::>{ out(\" ignores unused args\"); return 5.5; }\00(int x, int y)<::>{ out(\" skips unused args: \" + y); return 6; }\00(double x, double y, double z)<::>{ out(\" \" + x + \" + \" + z); return x + z; }\00(void)<::>{ out(\" can use <::> separator in user code\"); return 15; }\00(void)<::>{ var x, y; x = {}; y = 3; x[y] = [1, 2, 3]; out(\" can have commas in user code: \" + x[y]); return x[y][1]; }\00(void)<::>{ var jsString = \'\e3\81\93\e3\82\93\e3\81\ab\e3\81\a1\e3\81\af\'; var lengthBytes = lengthBytesUTF8(jsString); var stringOnWasmHeap = _malloc(lengthBytes); stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1); return stringOnWasmHeap; }\00(void)<::>{ var jsString = \'hello from js\'; var lengthBytes = jsString.length+1; var stringOnWasmHeap = _malloc(lengthBytes); stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1); return stringOnWasmHeap; }\00BEGIN\n\00 noarg_int returned: %d\n\00 noarg_double returned: %f\n\00 stringarg returned: %f\n\00string arg\00 multi_intarg returned: %d\n\00 multi_mixedarg returned: %f\n\00hello\00 unused_args returned: %d\n\00 skip_args returned: %f\n\00 add_outer returned: %f\n\00 user_separator returned: %d\n\00 user_comma returned: %d\n\00 return_str returned: %s\n\00 return_utf8_str returned: %s\n\00END\n\00\00\cc\1a\00\00\00\00\00\00\00\00\00\00\00\00\00\00T!\"\19\0d\01\02\03\11K\1c\0c\10\04\0b\1d\12\1e\'hnopqb \05\06\0f\13\14\15\1a\08\16\07($\17\18\t\n\0e\1b\1f%#\83\82}&*+<=>?CGJMXYZ[\\]^_`acdefgijklrstyz{|\00\00\00\00\00\00\00\00\00Illegal byte sequence\00Domain error\00Result not representable\00Not a tty\00Permission denied\00Operation not permitted\00No such file or directory\00No such process\00File exists\00Value too large for data type\00No space left on device\00Out of memory\00Resource busy\00Interrupted system call\00Resource temporarily unavailable\00Invalid seek\00Cross-device link\00Read-only file system\00Directory not empty\00Connection reset by peer\00Operation timed out\00Connection refused\00Host is down\00Host is unreachable\00Address in use\00Broken pipe\00I/O error\00No such device or address\00Block device required\00No such device\00Not a directory\00Is a directory\00Text file busy\00Exec format error\00Invalid argument\00Argument list too long\00Symbolic link loop\00Filename too long\00Too many open files in system\00No file descriptors available\00Bad file descriptor\00No child process\00Bad address\00File too large\00Too many links\00No locks available\00Resource deadlock would occur\00State not recoverable\00Previous owner died\00Operation canceled\00Function not implemented\00No message of desired type\00Identifier removed\00Device not a stream\00No data available\00Device timeout\00Out of streams resources\00Link has been severed\00Protocol error\00Bad message\00File descriptor in bad state\00Not a socket\00Destination address required\00Message too large\00Protocol wrong type for socket\00Protocol not available\00Protocol not supported\00Socket type not supported\00Not supported\00Protocol family not supported\00Address family not supported by protocol\00Address not available\00Network is down\00Network unreachable\00Connection reset by network\00Connection aborted\00No buffer space available\00Socket is connected\00Socket not connected\00Cannot send after socket shutdown\00Operation already in progress\00Operation in progress\00Stale file handle\00Remote I/O error\00Quota exceeded\00No medium found\00Wrong medium type\00No error information\00\00-+ 0X0x\00(null)\00\00\00\00\11\00\n\00\11\11\11\00\00\00\00\05\00\00\00\00\00\00\t\00\00\00\00\0b\00\00\00\00\00\00\00\00\11\00\0f\n\11\11\11\03\n\07\00\01\13\t\0b\0b\00\00\t\06\0b\00\00\0b\00\06\11\00\00\00\11\11\11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0b\00\00\00\00\00\00\00\00\11\00\n\n\11\11\11\00\n\00\00\02\00\t\0b\00\00\00\t\00\0b\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\0c\00\00\00\00\t\0c\00\00\00\00\00\0c\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\0d\00\00\00\04\0d\00\00\00\00\t\0e\00\00\00\00\00\0e\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\0f\00\00\00\00\0f\00\00\00\00\t\10\00\00\00\00\00\10\00\00\10\00\00\12\00\00\00\12\12\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\12\12\12\00\00\00\00\00\00\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\n\00\00\00\00\n\00\00\00\00\t\0b\00\00\00\00\00\0b\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\0c\00\00\00\00\t\0c\00\00\00\00\00\0c\00\00\0c\00\000123456789ABCDEF-0X+0X 0X-0x+0x 0x\00inf\00INF\00nan\00NAN\00.\00") + (data (i32.const 1024) "(void)<::>{ out(\"no args works\"); }\00(void)<::>{ out(\"no args returning int\"); return 12; }\00(void)<::>{ out(\"no args returning double\"); return 12.25; }\00(int x)<::>{ out(\" takes ints: \" + x);}\00(double d)<::>{ out(\" takes doubles: \" + d);}\00(char* str)<::>{ out(\" takes strings: \" + UTF8ToString(str)); return 7.75; }\00(int x, int y)<::>{ out(\" takes multiple ints: \" + x + \", \" + y); return 6; }\00(int x, const char* str, double d)<::>{ out(\" mixed arg types: \" + x + \", \" + UTF8ToString(str) + \", \" + d); return 8.125; }\00(int unused)<::>{ out(\" ignores unused args\"); return 5.5; }\00(int x, int y)<::>{ out(\" skips unused args: \" + y); return 6; }\00(double x, double y, double z)<::>{ out(\" \" + x + \" + \" + z); return x + z; }\00(void)<::>{ out(\" can use <::> separator in user code\"); return 15; }\00(void)<::>{ var x, y; x = {}; y = 3; x[y] = [1, 2, 3]; out(\" can have commas in user code: \" + x[y]); return x[y][1]; }\00(void)<::>{ var jsString = \'\e3\81\93\e3\82\93\e3\81\ab\e3\81\a1\e3\81\af\'; var lengthBytes = lengthBytesUTF8(jsString); var stringOnWasmHeap = _malloc(lengthBytes); stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1); return stringOnWasmHeap; }\00(void)<::>{ var jsString = \'hello from js\'; var lengthBytes = jsString.length+1; var stringOnWasmHeap = _malloc(lengthBytes); stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1); return stringOnWasmHeap; }\00BEGIN\n\00 noarg_int returned: %d\n\00 noarg_double returned: %f\n\00 stringarg returned: %f\n\00string arg\00 multi_intarg returned: %d\n\00 multi_mixedarg returned: %f\n\00hello\00 unused_args returned: %d\n\00 skip_args returned: %f\n\00 add_outer returned: %f\n\00 user_separator returned: %d\n\00 user_comma returned: %d\n\00 return_str returned: %s\n\00 return_utf8_str returned: %s\n\00END\n\00\00\cc\1a\00\00\00\00\00\00\00\00\00\00\00\00\00\00T!\"\19\r\01\02\03\11K\1c\0c\10\04\0b\1d\12\1e\'hnopqb \05\06\0f\13\14\15\1a\08\16\07($\17\18\t\n\0e\1b\1f%#\83\82}&*+<=>?CGJMXYZ[\\]^_`acdefgijklrstyz{|\00\00\00\00\00\00\00\00\00Illegal byte sequence\00Domain error\00Result not representable\00Not a tty\00Permission denied\00Operation not permitted\00No such file or directory\00No such process\00File exists\00Value too large for data type\00No space left on device\00Out of memory\00Resource busy\00Interrupted system call\00Resource temporarily unavailable\00Invalid seek\00Cross-device link\00Read-only file system\00Directory not empty\00Connection reset by peer\00Operation timed out\00Connection refused\00Host is down\00Host is unreachable\00Address in use\00Broken pipe\00I/O error\00No such device or address\00Block device required\00No such device\00Not a directory\00Is a directory\00Text file busy\00Exec format error\00Invalid argument\00Argument list too long\00Symbolic link loop\00Filename too long\00Too many open files in system\00No file descriptors available\00Bad file descriptor\00No child process\00Bad address\00File too large\00Too many links\00No locks available\00Resource deadlock would occur\00State not recoverable\00Previous owner died\00Operation canceled\00Function not implemented\00No message of desired type\00Identifier removed\00Device not a stream\00No data available\00Device timeout\00Out of streams resources\00Link has been severed\00Protocol error\00Bad message\00File descriptor in bad state\00Not a socket\00Destination address required\00Message too large\00Protocol wrong type for socket\00Protocol not available\00Protocol not supported\00Socket type not supported\00Not supported\00Protocol family not supported\00Address family not supported by protocol\00Address not available\00Network is down\00Network unreachable\00Connection reset by network\00Connection aborted\00No buffer space available\00Socket is connected\00Socket not connected\00Cannot send after socket shutdown\00Operation already in progress\00Operation in progress\00Stale file handle\00Remote I/O error\00Quota exceeded\00No medium found\00Wrong medium type\00No error information\00\00-+ 0X0x\00(null)\00\00\00\00\11\00\n\00\11\11\11\00\00\00\00\05\00\00\00\00\00\00\t\00\00\00\00\0b\00\00\00\00\00\00\00\00\11\00\0f\n\11\11\11\03\n\07\00\01\13\t\0b\0b\00\00\t\06\0b\00\00\0b\00\06\11\00\00\00\11\11\11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0b\00\00\00\00\00\00\00\00\11\00\n\n\11\11\11\00\n\00\00\02\00\t\0b\00\00\00\t\00\0b\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\0c\00\00\00\00\t\0c\00\00\00\00\00\0c\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\r\00\00\00\04\r\00\00\00\00\t\0e\00\00\00\00\00\0e\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\0f\00\00\00\00\0f\00\00\00\00\t\10\00\00\00\00\00\10\00\00\10\00\00\12\00\00\00\12\12\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\12\12\12\00\00\00\00\00\00\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\n\00\00\00\00\n\00\00\00\00\t\0b\00\00\00\00\00\0b\00\00\0b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\00\0c\00\00\00\00\t\0c\00\00\00\00\00\0c\00\00\0c\00\000123456789ABCDEF-0X+0X 0X-0x+0x 0x\00inf\00INF\00nan\00NAN\00.\00") (data (i32.const 5232) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 6860) "\05\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00\88\14\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\cc\1a\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\b0\18\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (export "__em_js__noarg" (func $__em_js__noarg)) diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt index 4a2d8a5c1..a5a0fc324 100644 --- a/test/passes/converge_O3_metrics.bin.txt +++ b/test/passes/converge_O3_metrics.bin.txt @@ -37,7 +37,7 @@ total (global $global$0 (mut i32) (i32.const 1)) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") - (data (i32.const 7028) "\0d\00\00\00\06") + (data (i32.const 7028) "\r\00\00\00\06") (data (i32.const 10888) "hello, world!") (data (i32.const 18100) "\b8\1a") (data (i32.const 18128) ",I") @@ -262,7 +262,7 @@ total (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") - (data (i32.const 7028) "\0d\00\00\00\06") + (data (i32.const 7028) "\r\00\00\00\06") (data (i32.const 10888) "hello, world!") (data (i32.const 18100) "\b8\1a") (data (i32.const 18128) ",I") @@ -482,7 +482,7 @@ total (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") - (data (i32.const 7028) "\0d\00\00\00\06") + (data (i32.const 7028) "\r\00\00\00\06") (data (i32.const 10888) "hello, world!") (data (i32.const 18100) "\b8\1a") (data (i32.const 18128) ",I") |