summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-20 18:39:19 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-20 18:39:19 -0700
commit34a74e9e72d2a572bb8ae9f820f4b553fa06632a (patch)
tree245a75228bcda9d9ab627186c7252454fcb9ac70 /src/passes/Print.cpp
parentc2d9d476b853212e96f301106cf00ceb19baefca (diff)
parent7ce2aefd8e14d6507fbe4abdcbbba9b0507944f0 (diff)
downloadbinaryen-34a74e9e72d2a572bb8ae9f820f4b553fa06632a.tar.gz
binaryen-34a74e9e72d2a572bb8ae9f820f4b553fa06632a.tar.bz2
binaryen-34a74e9e72d2a572bb8ae9f820f4b553fa06632a.zip
Merge pull request #374 from WebAssembly/opts
A few tiny optimization tweaks
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index ddeec3dce..59ade1c76 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -68,7 +68,10 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
Name printableLocal(Index index) {
- Name name = currFunction->tryLocalName(index);
+ Name name;
+ if (currFunction) {
+ name = currFunction->tryLocalName(index);
+ }
if (!name.is()) {
name = Name::fromInt(index);
}