File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 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 {
218218//
219219// Note that x86 Windows uses the "thiscall" calling convention for C++ member
220220// 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.
221227cfg_if:: cfg_if! {
222228 if #[ cfg( target_arch = "x86" ) ] {
223229 unsafe extern "thiscall" fn exception_cleanup( e: * mut [ u64 ; 2 ] ) {
224230 if ( * e) [ 0 ] != 0 {
225231 cleanup( * e) ;
226232 }
227233 }
234+ #[ unwind( allowed) ]
228235 unsafe extern "thiscall" fn exception_copy( _dest: * mut [ u64 ; 2 ] ,
229236 _src: * mut [ u64 ; 2 ] )
230237 -> * mut [ u64 ; 2 ] {
@@ -236,6 +243,7 @@ cfg_if::cfg_if! {
236243 cleanup( * e) ;
237244 }
238245 }
246+ #[ unwind( allowed) ]
239247 unsafe extern "C" fn exception_copy( _dest: * mut [ u64 ; 2 ] ,
240248 _src: * mut [ u64 ; 2 ] )
241249 -> * mut [ u64 ; 2 ] {
You can’t perform that action at this time.
0 commit comments