diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-19 17:18:59 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-19 18:49:42 -0700 |
commit | ba0a6541885d324b9562a79a8977ed8733191b7f (patch) | |
tree | 98fbbbd23421b75c9e47870f828161aec0d6494d /src/passes | |
parent | 38dc263c303be13bec2fcee713bdb18fa89057c8 (diff) | |
download | binaryen-ba0a6541885d324b9562a79a8977ed8733191b7f.tar.gz binaryen-ba0a6541885d324b9562a79a8977ed8733191b7f.tar.bz2 binaryen-ba0a6541885d324b9562a79a8977ed8733191b7f.zip |
globals mutability fixes
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/Print.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<PrintSExpression> { 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 << ')'; } |