diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-12-30 10:13:04 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-12-30 14:02:13 -0800 |
commit | c25d24447aeede9df0e76aac5176cf525522343b (patch) | |
tree | 77959388c602d6052868c38faf30405fa88d076c /src/passes/Print.cpp | |
parent | 575d695762f545e1c2784595d9c926488062f383 (diff) | |
download | binaryen-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.cpp | 8 |
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()); |