summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-16 16:57:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:54:59 -0700
commit38fdfdd800bc9c029ebd334ac9a08649b4d4d42e (patch)
tree98be368585a3ba74e31f5f7cba3bc104abe518f4 /src/passes/Print.cpp
parent2f5c81810d827be6412056fc33188bdae622d55d (diff)
downloadbinaryen-38fdfdd800bc9c029ebd334ac9a08649b4d4d42e.tar.gz
binaryen-38fdfdd800bc9c029ebd334ac9a08649b4d4d42e.tar.bz2
binaryen-38fdfdd800bc9c029ebd334ac9a08649b4d4d42e.zip
globals printing fix, handle the case with no module
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index c0d7ed345..02e9b9065 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -83,7 +83,8 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
Name printableGlobal(Index index) {
- return currModule->getGlobal(index)->name;
+ if (currModule) return currModule->getGlobal(index)->name;
+ return Name::fromInt(index);
}
std::ostream& printName(Name name) {