bridges/inc/msvc/except.hxx                    |    2 +-
 bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx |    3 ---
 bridges/source/cpp_uno/msvc_shared/except.cxx  |    2 ++
 3 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit be2f27b011d43cb3a5cb1aa352cc445083948103
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Thu Mar 21 14:06:03 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Mar 22 09:57:19 2024 +0100

    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.bergm...@allotropia.de>

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

Reply via email to