Skip to content

Commit c6b3e20

Browse files
committed
Remove some of the 3.0 3.x instruction hackiness
1 parent 93e889e commit c6b3e20

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

uncompyle6/scanners/scanner3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,9 @@ def detect_control_flow(self, offset, targets, inst_index):
663663
if not jump_back:
664664
return
665665

666-
jump_back += 2 # FIXME ???
666+
jb_inst = self.get_inst(jump_back)
667+
jump_back = self.next_offset(jb_inst.opcode, jump_back)
668+
667669
if_offset = None
668670
if code[self.prev_op[next_line_byte]] not in self.pop_jump_tf:
669671
if_offset = self.prev[next_line_byte]

uncompyle6/scanners/scanner30.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def detect_control_flow(self, offset, targets, inst_index):
8585
if not jump_back:
8686
return
8787

88-
jump_back += 2 # FIXME ???
88+
jb_inst = self.get_inst(jump_back)
89+
jump_back = self.next_offset(jb_inst.opcode, jump_back)
90+
8991
if_offset = None
9092
if code[self.prev_op[next_line_byte]] not in JUMP_TF:
9193
if_offset = self.prev[next_line_byte]

0 commit comments

Comments
 (0)