From 39afd2a64d72b251fc2da067d338d826b06985b7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 20 Apr 2016 17:42:04 -0700 Subject: do not crash when printing an expression whose function is not known --- src/passes/Print.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 { } Name printableLocal(Index index) { - Name name = currFunction->tryLocalName(index); + Name name; + if (currFunction) { + name = currFunction->tryLocalName(index); + } if (!name.is()) { name = Name::fromInt(index); } -- cgit v1.2.3