diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 3 |
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) { |