From 147626c9066e493f9e45d211b9f28626884cb515 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Fri, 6 Dec 2013 15:50:29 -0800 Subject: [PATCH] fix(kernel/printer): memory access violation when printing contexts Signed-off-by: Leonardo de Moura --- src/kernel/printer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kernel/printer.cpp b/src/kernel/printer.cpp index 87681109e..6f9dc446e 100644 --- a/src/kernel/printer.cpp +++ b/src/kernel/printer.cpp @@ -181,7 +181,9 @@ static void display_context_core(std::ostream & out, context const & ctx) { display_context_core(out, tail_ctx); if (!empty(tail_ctx)) out << "; "; - out << head.get_name() << " : " << mk_pair(head.get_domain(), tail_ctx); + out << head.get_name(); + if (head.get_domain()) + out << " : " << mk_pair(head.get_domain(), tail_ctx); if (head.get_body()) { out << " := " << mk_pair(head.get_body(), tail_ctx); }