Skip to content

Commit

Permalink
std: assert we discard a uleb128 number
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jul 22, 2024
1 parent ef516aa commit 92c988e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/std/src/sys/personality/dwarf/eh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result
let call_site_encoding = unsafe {
let ttype_encoding = reader.read::<u8>();
if ttype_encoding != DW_EH_PE_omit {
// Rust doesn't analyze exception types, so we don't care about the type table
reader.read_uleb128();
// discard the offset to the type table, we aren't interested
if ttype_encoding & 0x0F != DW_EH_PE_uleb128 {
rtabort!("ttype encoding assumed to not vary based on architecture! found: {:02X}", ttype_encoding & 0xF);
}
let _ = reader.read_uleb128();
}

reader.read::<u8>()
Expand Down

0 comments on commit 92c988e

Please sign in to comment.