From ba0a6541885d324b9562a79a8977ed8733191b7f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 19 Sep 2016 17:18:59 -0700 Subject: globals mutability fixes --- src/passes/Print.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 4cb363e66..06a8758c5 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -563,7 +563,11 @@ struct PrintSExpression : public Visitor { void visitGlobal(Global *curr) { printOpening(o, "global "); printName(curr->name) << ' '; - o << printWasmType(curr->type) << ' '; + if (curr->mutable_) { + o << "(mut " << printWasmType(curr->type) << ") "; + } else { + o << printWasmType(curr->type) << ' '; + } visit(curr->init); o << ')'; } -- cgit v1.2.3