From e45b3b0ff2ffc9bee6f090a4744f6d5eb6da8b72 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 26 Nov 2013 16:37:06 -0500 Subject: [PATCH] Fix a segfault in the printer infrastructure when called from API and no language is set --- src/printer/printer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/printer/printer.h b/src/printer/printer.h index d3a9201ee..6fe1ec279 100644 --- a/src/printer/printer.h +++ b/src/printer/printer.h @@ -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); } -- 2.30.2