From: Tim King Date: Thu, 17 Mar 2011 15:23:53 +0000 (+0000) Subject: Fix for the bug introduced in 1477. The stuff that was added to CVC4ostream::operato... X-Git-Tag: cvc5-1.0.0~8651 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a05b2c0204384032ddced67f743f48d4004f9b7;p=cvc5.git Fix for the bug introduced in 1477. The stuff that was added to CVC4ostream::operator<< should only be executed when d_os != NULL. This was the cause of the NULL pointer dereference in debug builds. --- diff --git a/src/util/output.h b/src/util/output.h index dd5007747..9efb4110e 100644 --- a/src/util/output.h +++ b/src/util/output.h @@ -169,10 +169,11 @@ public: CVC4ostream& operator<<(std::ostream& (*pf)(std::ostream&)) { if(d_os != NULL) { d_os = &(*d_os << pf); - } - if (pf == d_endl) { - for (unsigned i = 0; i < d_indent; ++ i) { - d_os = &(*d_os << '\t'); + + if (pf == d_endl) { + for (unsigned i = 0; i < d_indent; ++ i) { + d_os = &(*d_os << '\t'); + } } } return *this;