Fix bare except:s not catching anything #354

Merged
sb10q merged 1 commits from jcoates/artiq-zynq:dwarf-target2-ttype into master 2025-02-05 15:42:00 +08:00

View File

@ -85,7 +85,7 @@ unsafe fn get_ttype_entry(
encoding | DW_EH_PE_pcrel,
ttype_base,
)
.map(|v| (v != ttype_base).then(|| v as *const u8))
.map(|v| (v != 0).then(|| v as *const u8))
}
pub unsafe fn find_eh_action(
@ -275,6 +275,11 @@ unsafe fn read_encoded_pointer_with_base(reader: &mut DwarfReader, encoding: u8,
_ => return Err(()),
};
if result == 0 {
// null is just encoded as 0, even if a relative encoding is used for the table.
return Ok(0);
}
result += if (encoding & 0x70) == DW_EH_PE_pcrel {
original_ptr as usize
} else {