We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 211637d commit 15b7a08Copy full SHA for 15b7a08
library/panic_unwind/src/gcc.rs
@@ -306,7 +306,9 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> Result<EHAction,
306
let eh_context = EHContext {
307
// The return address points 1 byte past the call instruction,
308
// which could be in the next IP range in LSDA range table.
309
- ip: if ip_before_instr != 0 { ip } else { ip - 1 },
+ //
310
+ // `ip = -1` has special meaning, so use wrapping sub to allow for that
311
+ ip: if ip_before_instr != 0 { ip } else { ip.wrapping_sub(1) },
312
func_start: uw::_Unwind_GetRegionStart(context),
313
get_text_start: &|| uw::_Unwind_GetTextRelBase(context),
314
get_data_start: &|| uw::_Unwind_GetDataRelBase(context),
0 commit comments