aboutsummaryrefslogtreecommitdiff
path: root/editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx')
-rw-r--r--editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx52
1 files changed, 30 insertions, 22 deletions
diff --git a/editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx b/editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx
index 3d9108a73ece..b64d358e5742 100644
--- a/editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx
+++ b/editors/libreoffice/files/powerpc64/patch-bridges-source-cpp_uno-gcc3_linux_powerpc64-except.cxx
@@ -1,5 +1,5 @@
---- bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx.orig 2019-12-05 13:59:23.000000000 -0600
-+++ bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx 2020-09-14 11:24:58.489149000 -0500
+--- bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx.orig 2022-03-23 13:32:00 UTC
++++ bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx
@@ -24,6 +24,7 @@
#include <cxxabi.h>
#include <rtl/strbuf.hxx>
@@ -8,7 +8,7 @@
#include <osl/mutex.hxx>
#include <com/sun/star/uno/genfunc.hxx>
-@@ -136,7 +137,7 @@
+@@ -136,7 +137,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescrip
buf.append( 'E' );
OString symName( buf.makeStringAndClear() );
@@ -17,7 +17,7 @@
if (rtti)
{
-@@ -161,9 +162,9 @@
+@@ -161,9 +162,9 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescrip
{
// ensure availability of base
type_info * base_rtti = getRTTI(
@@ -29,18 +29,19 @@
}
else
{
-@@ -192,8 +193,8 @@
+@@ -192,8 +193,9 @@ static void deleteException( void * pExc )
static void deleteException( void * pExc )
{
- __cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
- typelib_TypeDescription * pTD = 0;
-+ __cxxabiv1::__cxa_exception const * header = static_cast<__cxxabiv1::__cxa_exception const *>(pExc) - 1;
++ __cxxabiv1::__cxa_exception * header =
++ reinterpret_cast<__cxxabiv1::__cxa_exception *>(pExc) - 1;
+ typelib_TypeDescription * pTD = nullptr;
OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pTD, unoName.pData );
assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!");
-@@ -216,39 +217,57 @@
+@@ -216,39 +218,59 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping *
if (! pTypeDescr)
terminate();
@@ -69,44 +70,51 @@
+ __cxxabiv1::__cxa_throw( pCppExc, rtti, deleteException );
}
- void fillUnoException(uno_Any * pExc, uno_Mapping * pCpp2Uno)
+-void fillUnoException(uno_Any * pExc, uno_Mapping * pCpp2Uno)
++void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno)
{
- __cxa_exception * header = __cxa_get_globals()->caughtExceptions;
-+ __cxxabiv1::__cxa_exception * header =
-+ __cxxabiv1::__cxa_get_globals()->caughtExceptions;
++ __cxxabiv1::__cxa_exception * header =
++ reinterpret_cast<__cxxabiv1::__cxa_exception *>(
++ __cxxabiv1::__cxa_current_primary_exception());
if (! header)
- terminate();
+- terminate();
++ {
++ RuntimeException aRE( "no exception header!" );
++ Type const & rType = cppu::UnoType<decltype(aRE)>::get();
++ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
++ SAL_WARN("bridges", aRE.Message);
++ return;
++ }
++ __cxxabiv1::__cxa_decrement_exception_refcount(header);
- std::type_info *exceptionType = __cxa_current_exception_type();
-+ std::type_info *exceptionType = __cxxabiv1::__cxa_current_exception_type();
++ std::type_info *exceptionType = header[-1].exceptionType;
- typelib_TypeDescription * pExcTypeDescr = 0;
+ typelib_TypeDescription * pExcTypeDescr = nullptr;
OUString unoName( toUNOname( exceptionType->name() ) );
- ::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
- if (! pExcTypeDescr)
+- terminate();
+-
+- // construct uno exception any
+- ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno );
+- ::typelib_typedescription_release( pExcTypeDescr );
+ typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
+ if (pExcTypeDescr == nullptr)
+ {
+ RuntimeException aRE( "exception type not found: " + unoName );
+ Type const & rType = cppu::UnoType<decltype(aRE)>::get();
-+ uno_type_any_constructAndConvert( pExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
++ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+ SAL_WARN("bridges", aRE.Message);
+ }
+ else
+ {
+ // construct uno exception any
-+ uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno );
++ uno_any_constructAndConvert( pUnoExc, header[-1].adjustedPtr, pExcTypeDescr, pCpp2Uno );
+ typelib_typedescription_release( pExcTypeDescr );
+ }
-+ if (nullptr == pExcTypeDescr)
- terminate();
-
- // construct uno exception any
-- ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno );
-- ::typelib_typedescription_release( pExcTypeDescr );
-+ uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno );
-+ typelib_typedescription_release( pExcTypeDescr );
}
}