@@ -156,14 +156,16 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
156
156
let eh_action = find_eh_action ( context) ;
157
157
if actions as i32 & uw:: _UA_SEARCH_PHASE as i32 != 0 {
158
158
match eh_action {
159
- EHAction :: None | EHAction :: Cleanup ( _) => return uw:: _URC_CONTINUE_UNWIND,
159
+ EHAction :: None |
160
+ EHAction :: Cleanup ( _) => return uw:: _URC_CONTINUE_UNWIND,
160
161
EHAction :: Catch ( _) => return uw:: _URC_HANDLER_FOUND,
161
162
EHAction :: Terminate => return uw:: _URC_FATAL_PHASE1_ERROR,
162
163
}
163
164
} else {
164
165
match eh_action {
165
166
EHAction :: None => return uw:: _URC_CONTINUE_UNWIND,
166
- EHAction :: Cleanup ( lpad) | EHAction :: Catch ( lpad) => {
167
+ EHAction :: Cleanup ( lpad) |
168
+ EHAction :: Catch ( lpad) => {
167
169
uw:: _Unwind_SetGR ( context, UNWIND_DATA_REG . 0 , exception_object as uintptr_t ) ;
168
170
uw:: _Unwind_SetGR ( context, UNWIND_DATA_REG . 1 , 0 ) ;
169
171
uw:: _Unwind_SetIP ( context, lpad) ;
@@ -182,7 +184,7 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
182
184
unsafe extern "C" fn rust_eh_personality ( state : uw:: _Unwind_State ,
183
185
exception_object : * mut uw:: _Unwind_Exception ,
184
186
context : * mut uw:: _Unwind_Context )
185
- -> uw:: _Unwind_Reason_Code {
187
+ -> uw:: _Unwind_Reason_Code {
186
188
let state = state as c_int ;
187
189
let action = state & uw:: _US_ACTION_MASK as c_int ;
188
190
let search_phase = if action == uw:: _US_VIRTUAL_UNWIND_FRAME as c_int {
@@ -191,7 +193,7 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
191
193
// we want to continue unwinding the stack, otherwise all our backtraces
192
194
// would end at __rust_try
193
195
if state & uw:: _US_FORCE_UNWIND as c_int != 0 {
194
- return continue_unwind ( exception_object, context)
196
+ return continue_unwind ( exception_object, context) ;
195
197
}
196
198
true
197
199
} else if action == uw:: _US_UNWIND_FRAME_STARTING as c_int {
@@ -207,7 +209,9 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
207
209
// To preserve signatures of functions like _Unwind_GetLanguageSpecificData(), which
208
210
// take only the context pointer, GCC personality routines stash a pointer to exception_object
209
211
// in the context, using location reserved for ARM's "scratch register" (r12).
210
- uw:: _Unwind_SetGR ( context, uw:: UNWIND_POINTER_REG , exception_object as uw:: _Unwind_Ptr ) ;
212
+ uw:: _Unwind_SetGR ( context,
213
+ uw:: UNWIND_POINTER_REG ,
214
+ exception_object as uw:: _Unwind_Ptr ) ;
211
215
// ...A more principled approach would be to provide the full definition of ARM's
212
216
// _Unwind_Context in our libunwind bindings and fetch the required data from there directly,
213
217
// bypassing DWARF compatibility functions.
@@ -223,7 +227,8 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
223
227
} else {
224
228
match eh_action {
225
229
EHAction :: None => return continue_unwind ( exception_object, context) ,
226
- EHAction :: Cleanup ( lpad) | EHAction :: Catch ( lpad) => {
230
+ EHAction :: Cleanup ( lpad) |
231
+ EHAction :: Catch ( lpad) => {
227
232
uw:: _Unwind_SetGR ( context, UNWIND_DATA_REG . 0 , exception_object as uintptr_t ) ;
228
233
uw:: _Unwind_SetGR ( context, UNWIND_DATA_REG . 1 , 0 ) ;
229
234
uw:: _Unwind_SetIP ( context, lpad) ;
@@ -247,8 +252,8 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
247
252
// defined in libgcc
248
253
extern "C" {
249
254
fn __gnu_unwind_frame ( exception_object : * mut uw:: _Unwind_Exception ,
250
- context : * mut uw:: _Unwind_Context )
251
- -> uw:: _Unwind_Reason_Code ;
255
+ context : * mut uw:: _Unwind_Context )
256
+ -> uw:: _Unwind_Reason_Code ;
252
257
}
253
258
}
254
259
0 commit comments