From 3255e4335f25f35318a41f174ec15a28b0f0520d Mon Sep 17 00:00:00 2001 From: Abdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com> Date: Tue, 8 Dec 2020 14:10:10 -0600 Subject: Fix a bug with synth-fun printer (#5512) This PR fixes #5448. SynthFunCommand::toStream used to call d_grammar->resolve even when d_grammar is a nullptr. This PR fixes the issue and modifies the signature of Printer::toStreamCmdSynthFun to make it clear that grammar is an optional argument. --- src/smt/command.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/smt') diff --git a/src/smt/command.cpp b/src/smt/command.cpp index cfd25fa3b..2a316409e 100644 --- a/src/smt/command.cpp +++ b/src/smt/command.cpp @@ -689,7 +689,8 @@ void SynthFunCommand::toStream(std::ostream& out, nodeVars, d_sort.getTypeNode(), d_isInv, - d_grammar->resolve().getTypeNode()); + d_grammar == nullptr ? TypeNode::null() + : d_grammar->resolve().getTypeNode()); } /* -------------------------------------------------------------------------- */ -- cgit v1.2.3