Skip to content

Commit 1b1223d

Browse files
authored
Rollup merge of #102685 - nbdd0121:unwind, r=m-ou-se
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 https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc#L522-L526. 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. ``@rustbot`` label: +T-compiler
2 parents 24722e8 + 8bda133 commit 1b1223d

File tree

1 file changed

+2
-3
lines changed
  • library/std/src/personality/dwarf

1 file changed

+2
-3
lines changed

library/std/src/personality/dwarf/eh.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result
9898
}
9999
}
100100
}
101-
// Ip is not present in the table. This should not happen... but it does: issue #35011.
102-
// So rather than returning EHAction::Terminate, we do this.
103-
Ok(EHAction::None)
101+
// Ip is not present in the table. This indicates a nounwind call.
102+
Ok(EHAction::Terminate)
104103
} else {
105104
// SjLj version:
106105
// The "IP" is an index into the call-site table, with two exceptions:

0 commit comments

Comments
 (0)