summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranonymous <local@localhost>2011-01-11 17:17:03 +0600
committeranonymous <local@localhost>2011-01-11 17:17:03 +0600
commit602a98f34de65587005ac2a52c3e10ce51830d79 (patch)
treec839d771560457f40b080c1cb90c3186e246fa4b
parent4b5cca4809ce87c3cb596e7f010042075022a873 (diff)
downloadlibcxxrt-602a98f34de65587005ac2a52c3e10ce51830d79.tar.gz
libcxxrt-602a98f34de65587005ac2a52c3e10ce51830d79.tar.bz2
libcxxrt-602a98f34de65587005ac2a52c3e10ce51830d79.tar.xz
fix for COMPILER-8918: don't add exception into list
of caught exceptions if it's already in the list
-rw-r--r--src/exception.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/exception.cc b/src/exception.cc
index 9cff21b..bc4cd02 100644
--- a/src/exception.cc
+++ b/src/exception.cc
@@ -864,10 +864,13 @@ extern "C" void *__cxa_begin_catch(void *e)
__cxa_exception *ex = (__cxa_exception*)
((char*)exceptionObject - offsetof(struct __cxa_exception, unwindHeader));
- // Add this to the front of the list of exceptions being handled and
- // increment its handler count so that it won't be deleted prematurely.
- ex->nextException = globals->caughtExceptions;
- globals->caughtExceptions = ex;
+ if (ex->handlerCount == 0)
+ {
+ // Add this to the front of the list of exceptions being handled and
+ // increment its handler count so that it won't be deleted prematurely.
+ ex->nextException = globals->caughtExceptions;
+ globals->caughtExceptions = ex;
+ }
if (ex->handlerCount < 0)
{