Fix a segfault in the printer infrastructure when called from API and no language...
authorMorgan Deters <mdeters@cs.nyu.edu>
Tue, 26 Nov 2013 21:37:06 +0000 (16:37 -0500)
committerMorgan Deters <mdeters@cs.nyu.edu>
Tue, 26 Nov 2013 21:37:06 +0000 (16:37 -0500)
src/printer/printer.h

index d3a9201ee1f739e270daf9aa70fbaf75c648ee3a..6fe1ec27938f266567531ce369b13ca2cc18bbb1 100644 (file)
@@ -53,6 +53,9 @@ protected:
 public:
   /** Get the Printer for a given OutputLanguage */
   static Printer* getPrinter(OutputLanguage lang) throw() {
+    if(lang == language::output::LANG_AUTO) {
+      lang = language::output::LANG_CVC4; // default
+    }
     if(d_printers[lang] == NULL) {
       d_printers[lang] = makePrinter(lang);
     }