This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-4
lines changed Expand file tree Collapse file tree 2 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
void RetailAssertIfExpectedClean (); // Defined in src/utilcode/debug.cpp
11
11
12
+ #ifdef FEATURE_PAL
13
+ #define EX_TRY_HOLDER \
14
+ NativeExceptionHolderCatchAll __exceptionHolder; \
15
+ __exceptionHolder.Push(); \
16
+
17
+ #else // FEATURE_PAL
18
+ #define EX_TRY_HOLDER
19
+ #endif // FEATURE_PAL
20
+
12
21
#ifdef CLR_STANDALONE_BINDER
13
22
14
23
#define INCONTRACT (x )
@@ -17,12 +26,16 @@ void RetailAssertIfExpectedClean(); // Defined in src/utilcode/debug
17
26
18
27
void DECLSPEC_NORETURN ThrowLastError();
19
28
20
- #define EX_TRY try
21
- #define EX_CATCH_HRESULT (_hr ) catch (HRESULT hr) { _hr = hr; }
22
- #define EX_CATCH catch (...)
29
+ #define EX_TRY \
30
+ try \
31
+ { \
32
+ EX_TRY_HOLDER \
33
+
34
+ #define EX_CATCH_HRESULT (_hr ) } catch (HRESULT hr) { _hr = hr; }
35
+ #define EX_CATCH } catch (...)
23
36
#define EX_END_CATCH (a )
24
37
#define EX_RETHROW throw
25
- #define EX_SWALLOW_NONTERMINAL catch (...) {}
38
+ #define EX_SWALLOW_NONTERMINAL } catch (...) {}
26
39
#define EX_END_CATCH_UNREACHABLE
27
40
#define EX_CATCH_HRESULT_NO_ERRORINFO (_hr ) \
28
41
EX_CATCH \
@@ -982,6 +995,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
982
995
{ \
983
996
/* this is necessary for Rotor exception handling to work */ \
984
997
DEBUG_ASSURE_NO_RETURN_BEGIN (EX_TRY) \
998
+ EX_TRY_HOLDER \
985
999
986
1000
987
1001
#define EX_CATCH_IMPL_EX (DerivedExceptionClass ) \
Original file line number Diff line number Diff line change @@ -6796,6 +6796,25 @@ class NativeExceptionHolder : public NativeExceptionHolderBase
6796
6796
}
6797
6797
};
6798
6798
6799
+ //
6800
+ // This is a native exception holder that is used when the catch catches
6801
+ // all exceptions.
6802
+ //
6803
+ class NativeExceptionHolderCatchAll : public NativeExceptionHolderBase
6804
+ {
6805
+
6806
+ public :
6807
+ NativeExceptionHolderCatchAll ()
6808
+ : NativeExceptionHolderBase ()
6809
+ {
6810
+ }
6811
+
6812
+ virtual EXCEPTION_DISPOSITION InvokeFilter (PAL_SEHException & ex )
6813
+ {
6814
+ return EXCEPTION_EXECUTE_HANDLER ;
6815
+ }
6816
+ };
6817
+
6799
6818
//
6800
6819
// This factory class for the native exception holder is necessary because
6801
6820
// templated functions don't need the explicit type parameter and can infer
You can’t perform that action at this time.
0 commit comments