gimli-rs / gimli

A library for reading and writing the DWARF debugging format
https://docs.rs/gimli/
Apache License 2.0
831 stars 105 forks source link

Fix encoding of .eh_frame for small LSDA encoding #704

Closed bjorn3 closed 5 months ago

bjorn3 commented 5 months ago

Without this an LSDA encoded as DW_EH_PE_pcrel | DW_EH_PE_sdata4 would cause the .eh_frame section to be corrupt. I found this issue while implementing unwinding support for cg_clif.

bjorn3 commented 5 months ago

Done and checked that the test catches this bug:

---- write::cfi::tests::test_frame_table stdout ----
thread 'write::cfi::tests::test_frame_table' panicked at src/write/cfi.rs:945:22:
called `Result::unwrap()` on an `Err` value: Read(UnexpectedEof(ReaderOffsetId(139971507795137)))