Fix local and globals wast functions.

This commit is contained in:
chriseth
2019-10-31 17:41:31 +01:00
parent d932f2d0c2
commit 04c62e2dc3
2 changed files with 53 additions and 53 deletions
+4 -4
View File
@@ -74,12 +74,12 @@ string EWasmToText::operator()(wasm::StringLiteral const& _literal)
string EWasmToText::operator()(wasm::LocalVariable const& _identifier)
{
return "(get_local $" + _identifier.name + ")";
return "(local.get $" + _identifier.name + ")";
}
string EWasmToText::operator()(wasm::GlobalVariable const& _identifier)
{
return "(get_global $" + _identifier.name + ")";
return "(global.get $" + _identifier.name + ")";
}
string EWasmToText::operator()(wasm::BuiltinCall const& _builtinCall)
@@ -96,12 +96,12 @@ string EWasmToText::operator()(wasm::FunctionCall const& _functionCall)
string EWasmToText::operator()(wasm::LocalAssignment const& _assignment)
{
return "(set_local $" + _assignment.variableName + " " + visit(*_assignment.value) + ")\n";
return "(local.set $" + _assignment.variableName + " " + visit(*_assignment.value) + ")\n";
}
string EWasmToText::operator()(wasm::GlobalAssignment const& _assignment)
{
return "(set_global $" + _assignment.variableName + " " + visit(*_assignment.value) + ")\n";
return "(global.set $" + _assignment.variableName + " " + visit(*_assignment.value) + ")\n";
}
string EWasmToText::operator()(wasm::If const& _if)