diff options
| author | Gary Guo <gary@garyguo.net> | 2022-10-05 02:29:56 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2022-10-05 03:09:43 +0100 |
| commit | 8bda13367e4987937ddc2ba9bbe01b5f7a4cce3e (patch) | |
| tree | c0e4909ed738ca8257ae1c5cb1db8647ea14ff69 /library/std | |
| parent | 01af5040fdada6ef8f1b749cda798d80a8590b2c (diff) | |
| download | rust-8bda13367e4987937ddc2ba9bbe01b5f7a4cce3e.tar.gz rust-8bda13367e4987937ddc2ba9bbe01b5f7a4cce3e.zip | |
Interpret EH actions properly
The EH actions stored in the LSDA follows the format of GCC except table (even for LLVM-generated code). An missing action in the table is the encoding for `Terminate`, see [1]. The currently code interprets it as `None`, as a workaround for #35011, an issue that seems to occur in LLVM 3.7 and not after 3.9. These are very old versions of LLVM and we don't support them anymore, so remove this workaround and interpret them properly. Note that LLVM currently does not emit any `Terminate` actions, but GCC does. Although GCC backend currently doesn't do unwinding, removing it preemptively would prevent future developers from wasting time to figure out what's wrong. [1]: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc#L522-L526
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/personality/dwarf/eh.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/library/std/src/personality/dwarf/eh.rs b/library/std/src/personality/dwarf/eh.rs index 8799137b78f..27b50c13b77 100644 --- a/library/std/src/personality/dwarf/eh.rs +++ b/library/std/src/personality/dwarf/eh.rs @@ -98,9 +98,8 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result } } } - // Ip is not present in the table. This should not happen... but it does: issue #35011. - // So rather than returning EHAction::Terminate, we do this. - Ok(EHAction::None) + // Ip is not present in the table. This indicates a nounwind call. + Ok(EHAction::Terminate) } else { // SjLj version: // The "IP" is an index into the call-site table, with two exceptions: |
