[ewasm] Properly encode i32/i64.select in the text format

This commit is contained in:
Alex Beregszaszi
2020-12-01 11:22:38 +00:00
parent 91e67472bf
commit a29a7ad680
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -122,8 +122,11 @@ string TextTransform::operator()(wasm::BuiltinCall const& _builtinCall)
{
string args = joinTransformed(_builtinCall.arguments);
string funcName = _builtinCall.functionName;
// These are prefixed in the dialect, but are actually overloaded instructions in WebAssembly.
if (funcName == "i32.drop" || funcName == "i64.drop")
funcName = "drop";
else if (funcName == "i32.select" || funcName == "i64.select")
funcName = "select";
return "(" + funcName + (args.empty() ? "" : " " + args) + ")";
}