summaryrefslogtreecommitdiff
path: root/src/smt/command.cpp
diff options
context:
space:
mode:
authorAbdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com>2020-12-08 14:10:10 -0600
committerGitHub <noreply@github.com>2020-12-08 14:10:10 -0600
commit3255e4335f25f35318a41f174ec15a28b0f0520d (patch)
treecc79f2a3f325167d3210a1d89e2114e369cf6282 /src/smt/command.cpp
parent0ab8a3a7af5b80aa7bcaa028276cdc396aa7a4cb (diff)
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.
Diffstat (limited to 'src/smt/command.cpp')
-rw-r--r--src/smt/command.cpp3
1 files changed, 2 insertions, 1 deletions
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());
}
/* -------------------------------------------------------------------------- */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback