From 38fdfdd800bc9c029ebd334ac9a08649b4d4d42e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 16 Aug 2016 16:57:01 -0700 Subject: globals printing fix, handle the case with no module --- src/passes/Print.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 { } 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) { -- cgit v1.2.3