summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-12-30 10:13:04 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-12-30 14:02:13 -0800
commitc25d24447aeede9df0e76aac5176cf525522343b (patch)
tree77959388c602d6052868c38faf30405fa88d076c /src/passes/Print.cpp
parent575d695762f545e1c2784595d9c926488062f383 (diff)
downloadbinaryen-c25d24447aeede9df0e76aac5176cf525522343b.tar.gz
binaryen-c25d24447aeede9df0e76aac5176cf525522343b.tar.bz2
binaryen-c25d24447aeede9df0e76aac5176cf525522343b.zip
emit globals before table and memory, because they may use a global for their element/segment offsets
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index c6fca0256..3c847809f 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -698,15 +698,15 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
visitImport(child.get());
o << maybeNewLine;
}
- if (curr->table.exists) {
- visitTable(&curr->table); // Prints its own newlines
- }
- visitMemory(&curr->memory);
for (auto& child : curr->globals) {
doIndent(o, indent);
visitGlobal(child.get());
o << maybeNewLine;
}
+ if (curr->table.exists) {
+ visitTable(&curr->table); // Prints its own newlines
+ }
+ visitMemory(&curr->memory);
for (auto& child : curr->exports) {
doIndent(o, indent);
visitExport(child.get());