File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -218,13 +218,20 @@ static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor {
218
218
//
219
219
// Note that x86 Windows uses the "thiscall" calling convention for C++ member
220
220
// functions instead of the default "C" calling convention.
221
+ //
222
+ // The exception_copy function is a bit special here: it is invoked by the MSVC
223
+ // runtime under a try/catch block and the panic that we generate here will be
224
+ // used as the result of the exception copy. This is used by the C++ runtime to
225
+ // support capturing exceptions with std::exception_ptr, which we can't support
226
+ // because Box<dyn Any> isn't clonable.
221
227
cfg_if:: cfg_if! {
222
228
if #[ cfg( target_arch = "x86" ) ] {
223
229
unsafe extern "thiscall" fn exception_cleanup( e: * mut [ u64 ; 2 ] ) {
224
230
if ( * e) [ 0 ] != 0 {
225
231
cleanup( * e) ;
226
232
}
227
233
}
234
+ #[ unwind( allowed) ]
228
235
unsafe extern "thiscall" fn exception_copy( _dest: * mut [ u64 ; 2 ] ,
229
236
_src: * mut [ u64 ; 2 ] )
230
237
-> * mut [ u64 ; 2 ] {
@@ -236,6 +243,7 @@ cfg_if::cfg_if! {
236
243
cleanup( * e) ;
237
244
}
238
245
}
246
+ #[ unwind( allowed) ]
239
247
unsafe extern "C" fn exception_copy( _dest: * mut [ u64 ; 2 ] ,
240
248
_src: * mut [ u64 ; 2 ] )
241
249
-> * mut [ u64 ; 2 ] {
You can’t perform that action at this time.
0 commit comments