summaryrefslogtreecommitdiff
path: root/src/util/exception.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-11-27 05:52:21 +0000
committerMorgan Deters <mdeters@gmail.com>2012-11-27 05:52:21 +0000
commit41fc06dc6352a847f047970e63e46455eb4dd050 (patch)
tree92f08943a4782f24f0cb44935d612b400a612592 /src/util/exception.cpp
parentb122cec27ca27d0b48e786191448e0053be78ed0 (diff)
First chunk of boolean-terms support.
Passes simple tests and doesn't break existing functionality. Still need some work merged in for models. This version enables BV except for pure arithmetic (since we might otherwise need Boolean term support, which uses BV). Tonight's nightly regression run should tell us if/how that hurts performance. (this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/util/exception.cpp')
-rw-r--r--src/util/exception.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/exception.cpp b/src/util/exception.cpp
index 95d307744..92f5c1840 100644
--- a/src/util/exception.cpp
+++ b/src/util/exception.cpp
@@ -19,6 +19,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
+#include "util/cvc4_assert.h"
using namespace std;
using namespace CVC4;
@@ -63,7 +64,14 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
setMessage(string(buf));
+#ifdef CVC4_DEBUG
+ if(s_debugLastException == NULL) {
+ // we leak buf[] but only in debug mode with assertions failing
+ s_debugLastException = buf;
+ }
+#else /* CVC4_DEBUG */
delete [] buf;
+#endif /* CVC4_DEBUG */
}
void IllegalArgumentException::construct(const char* header, const char* extra,
@@ -96,5 +104,12 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
setMessage(string(buf));
+#ifdef CVC4_DEBUG
+ if(s_debugLastException == NULL) {
+ // we leak buf[] but only in debug mode with assertions failing
+ s_debugLastException = buf;
+ }
+#else /* CVC4_DEBUG */
delete [] buf;
+#endif /* CVC4_DEBUG */
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback