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/base/cvc4_assert.h | |
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/base/cvc4_assert.h')
-rw-r--r-- | src/base/cvc4_assert.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base/cvc4_assert.h b/src/base/cvc4_assert.h index 6b47de8cc..63ed6d53e 100644 --- a/src/base/cvc4_assert.h +++ b/src/base/cvc4_assert.h @@ -235,8 +235,6 @@ public: #ifdef CVC4_DEBUG -extern CVC4_THREADLOCAL(const char*) s_debugLastException; - /** * Special assertion failure handling in debug mode; in non-debug * builds, the exception is thrown from the macro. We factor out this @@ -254,9 +252,12 @@ void debugAssertionFailed(const AssertionException& thisException, const char* l // details of the exception # define AlwaysAssert(cond, msg...) \ do { \ - if(__builtin_expect( ( ! (cond) ), false )) { \ + if(__builtin_expect( ( ! (cond) ), false )) { \ /* save the last assertion failure */ \ - const char* lastException = ::CVC4::s_debugLastException; \ + ::CVC4::LastExceptionBuffer* buffer = \ + ::CVC4::LastExceptionBuffer::getCurrent(); \ + const char* lastException = (buffer == NULL) ? \ + NULL : buffer->getContents(); \ ::CVC4::AssertionException exception(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ ::CVC4::debugAssertionFailed(exception, lastException); \ } \ |