summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2016-09-28 17:38:44 -0700
committerGitHub <noreply@github.com>2016-09-28 17:38:44 -0700
commit2234cc7374797d188761916f6b1e82ce9ade1fa3 (patch)
tree293a9ddc5392b4a8ce7fdfaf48b9071463433c47 /src/passes/Print.cpp
parent345b04253dcf7d42dcefabdec4e4b0edc3a3ca44 (diff)
downloadbinaryen-2234cc7374797d188761916f6b1e82ce9ade1fa3.tar.gz
binaryen-2234cc7374797d188761916f6b1e82ce9ade1fa3.tar.bz2
binaryen-2234cc7374797d188761916f6b1e82ce9ade1fa3.zip
Print the name of memory along with size (#720)
Otherwise when we export it as "$0" it's an undefined name. The spec interpreter actually rejects this, although I think it's intended to work, given the tests in export.wast. wabt also accepts it.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index c3ca4021e..572732275 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -645,6 +645,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void printMemoryHeader(Memory* curr) {
printOpening(o, "memory") << ' ';
+ printName(curr->name) << ' ';
o << curr->initial;
if (curr->max && curr->max != Memory::kMaxSize) o << ' ' << curr->max;
o << ")";