File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ use unwind as uw;
5757#[ repr( C ) ]
5858struct Exception {
5959 _uwe : uw:: _Unwind_Exception ,
60- cause : Option < Box < dyn Any + Send > > ,
60+ cause : Box < dyn Any + Send > ,
6161}
6262
6363pub unsafe fn panic ( data : Box < dyn Any + Send > ) -> u32 {
@@ -67,7 +67,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
6767 exception_cleanup,
6868 private : [ 0 ; uw:: unwinder_private_data_size] ,
6969 } ,
70- cause : Some ( data) ,
70+ cause : data,
7171 } ) ;
7272 let exception_param = Box :: into_raw ( exception) as * mut uw:: _Unwind_Exception ;
7373 return uw:: _Unwind_RaiseException ( exception_param) as u32 ;
@@ -87,10 +87,8 @@ pub fn payload() -> *mut u8 {
8787}
8888
8989pub unsafe fn cleanup ( ptr : * mut u8 ) -> Box < dyn Any + Send > {
90- let my_ep = ptr as * mut Exception ;
91- let cause = ( * my_ep) . cause . take ( ) ;
92- uw:: _Unwind_DeleteException ( ptr as * mut _ ) ;
93- cause. unwrap ( )
90+ let exception = Box :: from_raw ( ptr as * mut Exception ) ;
91+ exception. cause
9492}
9593
9694// Rust's exception class identifier. This is used by personality routines to
You can’t perform that action at this time.
0 commit comments