summaryrefslogtreecommitdiff
path: root/src/expr/node.cpp
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-01-05 11:36:30 -0800
committerTim King <taking@google.com>2016-01-05 11:36:30 -0800
commitb717513e2a1d956c4456d13e0625957fc84c2449 (patch)
tree50b8a1fbd720fd5094004bde02de0ca61780df30 /src/expr/node.cpp
parent541c88a37f0880d7ea42a1aaa3a8688fc86ac811 (diff)
Adding a new class LastExceptionBuffer for the purpose of owning the memory for the last exception C string. This replaces s_debugLastException.
Diffstat (limited to 'src/expr/node.cpp')
-rw-r--r--src/expr/node.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/expr/node.cpp b/src/expr/node.cpp
index 2b5c0a2c8..cf9a772b7 100644
--- a/src/expr/node.cpp
+++ b/src/expr/node.cpp
@@ -18,6 +18,7 @@
#include <iostream>
#include <cstring>
+#include "base/exception.h"
#include "base/output.h"
#include "expr/attribute.h"
@@ -31,8 +32,10 @@ TypeCheckingExceptionPrivate::TypeCheckingExceptionPrivate(TNode node,
Exception(message),
d_node(new Node(node)) {
#ifdef CVC4_DEBUG
- // yes, this leaks memory, but only in debug modes with exceptions occurring
- s_debugLastException = strdup(toString().c_str());
+ LastExceptionBuffer* current = LastExceptionBuffer::getCurrent();
+ if(current != NULL){
+ current->setContents(toString().c_str());
+ }
#endif /* CVC4_DEBUG */
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback