From 602a98f34de65587005ac2a52c3e10ce51830d79 Mon Sep 17 00:00:00 2001 From: anonymous Date: Tue, 11 Jan 2011 17:17:03 +0600 Subject: fix for COMPILER-8918: don't add exception into list of caught exceptions if it's already in the list --- src/exception.cc | 11 +++++++---- 1 file 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) { -- cgit v1.2.3