diff options
| author | Mads Marquart <mads@marquart.dk> | 2022-07-30 05:11:00 +0200 |
|---|---|---|
| committer | Mads Marquart <mads@marquart.dk> | 2022-07-30 05:14:54 +0200 |
| commit | 15b7a087471533086df538bc1a21b475f3ef032e (patch) | |
| tree | e31c03b766ec7e3556f2a32dd2715acf1437b8f3 /library/panic_unwind/src | |
| parent | 211637d0802a1c17d41b414e091e9a8691b26068 (diff) | |
| download | rust-15b7a087471533086df538bc1a21b475f3ef032e.tar.gz rust-15b7a087471533086df538bc1a21b475f3ef032e.zip | |
Fix unwinding when debug assertions are enabled
This came up on armv7-apple-ios when using -Zbuild-std
Diffstat (limited to 'library/panic_unwind/src')
| -rw-r--r-- | library/panic_unwind/src/gcc.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs index 057e47bfdd1..a596592311a 100644 --- a/library/panic_unwind/src/gcc.rs +++ b/library/panic_unwind/src/gcc.rs @@ -306,7 +306,9 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> Result<EHAction, let eh_context = EHContext { // The return address points 1 byte past the call instruction, // which could be in the next IP range in LSDA range table. - ip: if ip_before_instr != 0 { ip } else { ip - 1 }, + // + // `ip = -1` has special meaning, so use wrapping sub to allow for that + ip: if ip_before_instr != 0 { ip } else { ip.wrapping_sub(1) }, func_start: uw::_Unwind_GetRegionStart(context), get_text_start: &|| uw::_Unwind_GetTextRelBase(context), get_data_start: &|| uw::_Unwind_GetDataRelBase(context), |
