diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-10-14 16:45:26 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-10-14 16:45:26 -0400 |
| commit | 7d0b6bc3f49070a10d6257628bbdf93e52d87fed (patch) | |
| tree | 47c5bb38d996dcb0d71cbbe12eb5cc1fc5d0c44f /rust | |
| parent | a10ba14f3528577432f51a940fcadc69a535af4b (diff) | |
Fix DWARF import crash when FDE has row with start==end
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/examples/dwarf/dwarf_import/src/lib.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs index 076586f1..58e66dda 100644 --- a/rust/examples/dwarf/dwarf_import/src/lib.rs +++ b/rust/examples/dwarf/dwarf_import/src/lib.rs @@ -358,10 +358,15 @@ where <U as UnwindSection<R>>::Offset: std::hash::Hash { match row.cfa() { CfaRule::RegisterAndOffset {register: _, offset} => { // TODO: we should store offsets by register - cfa_offsets.insert( - row.start_address()..row.end_address(), - *offset, - ); + if row.start_address() < row.end_address() { + cfa_offsets.insert( + row.start_address()..row.end_address(), + *offset, + ); + } + else { + debug!("Invalid FDE table row addresses: {:#x}..{:#x}", row.start_address(), row.end_address()); + } }, CfaRule::Expression(_) => { debug!("Unhandled CFA expression when determining offset"); |
