fixed previous problem
authorEli Bendersky <eliben@gmail.com>
Fri, 16 Dec 2011 11:16:27 +0000 (13:16 +0200)
committerEli Bendersky <eliben@gmail.com>
Fri, 16 Dec 2011 11:16:27 +0000 (13:16 +0200)
elftools/dwarf/lineprogram.py

index 45bca2dc510714eecbdce598a5a1d3719e523bee..4d9c7b0e57bc92d2a9f7ac91412fb6bf9b6a02bb 100644 (file)
@@ -184,8 +184,10 @@ class LineProgram(object):
                     add_entry_old_state(ex_opcode, [operand], is_extended=True)
                 else:
                     # Unknown, but need to roll forward the stream because the
-                    # length is specified
-                    self.stream.seek(inst_len, os.SEEK_CUR)
+                    # length is specified. Seek forward inst_len - 1 because
+                    # we've already read the extended opcode, which takes part
+                    # in the length.
+                    self.stream.seek(inst_len - 1, os.SEEK_CUR)
             else: # 0 < opcode < opcode_base
                 # Standard opcode
                 if opcode == DW_LNS_copy: