Fix null case for sygus printing (#4793)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 30 Jul 2020 14:54:57 +0000 (09:54 -0500)
committerGitHub <noreply@github.com>
Thu, 30 Jul 2020 14:54:57 +0000 (09:54 -0500)
Avoids crashing on some of our debug traces.

src/theory/quantifiers/sygus/term_database_sygus.cpp

index ff1b172e9db0121c00db9963ac990da8ccd3cc17..ac10522a262aaa6f99bde240c539e66300e2d3ed 100644 (file)
@@ -731,6 +731,11 @@ void TermDbSygus::toStreamSygus(const char* c, Node n)
 
 void TermDbSygus::toStreamSygus(std::ostream& out, Node n)
 {
+  if (n.isNull())
+  {
+    out << n;
+    return;
+  }
   // use external conversion
   out << datatypes::utils::sygusToBuiltin(n, true);
 }