gimli-rs / gimli

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

Fix Op::ImplicitPointer::size() to match Op::ImplicitPointer::write() #712

Closed crzysdrs closed 7 months ago

crzysdrs commented 7 months ago

The size function did not mirror the corresponding size adjustment based on dwarf version 2 found in write causing an assertion to fail due to a mismatch between the expected location and the actual write location.

thread '<unnamed>' panicked at /home/crzysdrs/proj/gimli/src/write/unit.rs:620:9:
assertion `left == right` failed
  left: DebugInfoOffset(1324)
 right: DebugInfoOffset(1328)

This looks like an oversight on my part when contributing #618.