From 4c547a2ce9532383ce615f3933af65097e7b36f5 Mon Sep 17 00:00:00 2001 From: rvijayc <44033253+rvijayc@users.noreply.github.com> Date: Tue, 18 Dec 2018 05:46:05 -0800 Subject: [PATCH] Bugfix: Reset prevstate if line program sequence ends (#211) --- examples/dwarf_decode_address.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- 2.30.2