From: rvijayc <44033253+rvijayc@users.noreply.github.com> Date: Tue, 18 Dec 2018 13:46:05 +0000 (-0800) Subject: Bugfix: Reset prevstate if line program sequence ends (#211) X-Git-Tag: v0.26~31 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c547a2ce9532383ce615f3933af65097e7b36f5;p=pyelftools.git Bugfix: Reset prevstate if line program sequence ends (#211) --- diff --git a/examples/dwarf_decode_address.py b/examples/dwarf_decode_address.py index 7b7d3e0..047ce3b 100644 --- a/examples/dwarf_decode_address.py +++ b/examples/dwarf_decode_address.py @@ -83,7 +83,11 @@ def decode_file_line(dwarfinfo, address): prevstate = None for entry in lineprog.get_entries(): # We're interested in those entries where a new state is assigned - if entry.state is None or entry.state.end_sequence: + if entry.state is None: + continue + if entry.state.end_sequence: + # if the line number sequence ends, clear prevstate. + prevstate = None continue # Looking for a range of addresses in two consecutive states that # contain the required address.