summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-21 14:06:03 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-22 09:57:19 +0100
commitbe2f27b011d43cb3a5cb1aa352cc445083948103 (patch)
treecbb3fad5fbc01a92e127d6662d110c83e593d89a /bridges
parent065fa9d77e5bd550600e8985d7e7aac8e10745c4 (diff)
Make msvc_raiseException explicitly [[noreturn]]
The comments at <https://gerrit.libreoffice.org/c/core/+/165113/1#message-a76a16ede60a817426763c1c2c2090f23ae141e0> "framework: MenuBarManager: fix WNT crash if queryDispatch() throws" suggest that it was observed returning normally, and running into the > // is here for dummy > return typelib_TypeClass_VOID; in cpp2uno_call. Change-Id: I792a9eb82ef9e737aa69dc651b9a072871c0756b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165152 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'bridges')
-rw-r--r--bridges/inc/msvc/except.hxx2
-rw-r--r--bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx3
-rw-r--r--bridges/source/cpp_uno/msvc_shared/except.cxx2
3 files changed, 3 insertions, 4 deletions
diff --git a/bridges/inc/msvc/except.hxx b/bridges/inc/msvc/except.hxx
index f1403a43af88..29fe007a435f 100644
--- a/bridges/inc/msvc/except.hxx
+++ b/bridges/inc/msvc/except.hxx
@@ -33,7 +33,7 @@ typedef struct _uno_Any uno_Any;
typedef struct _uno_Mapping uno_Mapping;
int msvc_filterCppException(EXCEPTION_POINTERS*, uno_Any*, uno_Mapping*);
-void msvc_raiseException(uno_Any*, uno_Mapping*);
+[[noreturn]] void msvc_raiseException(uno_Any*, uno_Mapping*);
constexpr DWORD MSVC_EH_MAGIC_PARAM = 0x19930520;
// The NT Exception code that msvcrt uses ('msc' | 0xE0000000)
diff --git a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
index 15aa14d9b90b..d2bbf5ab22b4 100644
--- a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
@@ -163,9 +163,6 @@ cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
TYPELIB_DANGER_RELEASE(pReturnTD);
msvc_raiseException(&aUnoExc, pThis->getBridge()->getUno2Cpp()); // has to destruct the any
-
- // is here for dummy
- return typelib_TypeClass_VOID;
}
else // no exception occurred...
{
diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx b/bridges/source/cpp_uno/msvc_shared/except.cxx
index b68dd41d6bdc..b6c6715e0336 100644
--- a/bridges/source/cpp_uno/msvc_shared/except.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/except.cxx
@@ -21,6 +21,7 @@
#include <memory>
+#include <cstdlib>
#include <malloc.h>
#include <new.h>
#include <typeinfo>
@@ -196,6 +197,7 @@ void msvc_raiseException(uno_Any* pUnoExc, uno_Mapping* pUno2Cpp)
// last point to release anything not affected by stack unwinding
RaiseException(MSVC_EH_MAGIC_CODE, EXCEPTION_NONCONTINUABLE, MSVC_EH_PARAMETERS, arFilterArgs);
+ std::abort();
}
// This function does the same check as __CxxDetectRethrow from msvcrt (see its