diff options
author | Tim King <taking@google.com> | 2016-01-05 11:36:30 -0800 |
---|---|---|
committer | Tim King <taking@google.com> | 2016-01-05 11:36:30 -0800 |
commit | b717513e2a1d956c4456d13e0625957fc84c2449 (patch) | |
tree | 50b8a1fbd720fd5094004bde02de0ca61780df30 /src/expr/node.cpp | |
parent | 541c88a37f0880d7ea42a1aaa3a8688fc86ac811 (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.cpp | 7 |
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 */ } |