Skip to content

Commit 21a4f01

Browse files
std: assert we discard a uleb128 number
1 parent ef516aa commit 21a4f01

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result
8383
let call_site_encoding = unsafe {
8484
let ttype_encoding = reader.read::<u8>();
8585
if ttype_encoding != DW_EH_PE_omit {
86-
// Rust doesn't analyze exception types, so we don't care about the type table
87-
reader.read_uleb128();
86+
// discard the offset to the type table, we aren't interested
87+
if ttype_encoding & 0x0F == DW_EH_PE_uleb128 {
88+
rtabort!("ttype encoding assumed to not vary based on architecture.");
89+
}
90+
let _ = reader.read_uleb128();
8891
}
8992

9093
reader.read::<u8>()

0 commit comments

Comments
 (0)