diff --git a/Makefile b/Makefile index 3cd37b33..eb24ba59 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ check-2.6: #:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0 # Skip for now -2.6 5.0 5.3 5.8: +2.6 5.0 5.3 5.6 5.8: #:PyPy pypy3-2.4.0 Python 3: pypy-3.2 2.4: diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index 34fb1bce..0d4b679a 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -487,26 +487,17 @@ class Scanner3(Scanner): self.setup_loops = {} # setup_loop offset given target targets = {} - extended_arg = 0 - for offset in self.op_range(0, n): - op = code[offset] - - if op == self.opc.EXTENDED_ARG: - arg = code2num(code, offset+1) | extended_arg - extended_arg = self.extended_arg_val(arg) - continue + for i, inst in enumerate(self.insts): + offset = inst.offset + op = inst.opcode # Determine structures and fix jumps in Python versions # since 2.3 - self.detect_control_flow(offset, targets, extended_arg) + self.detect_control_flow(offset, targets, 0) - has_arg = (op >= op3.HAVE_ARGUMENT) - if has_arg: + if inst.has_arg: label = self.fixed_jumps.get(offset) - if self.version >= 3.6: - oparg = code[offset+1] - else: - oparg = code[offset+1] + code[offset+2] * 256 + oparg = inst.arg next_offset = xdis.next_offset(op, self.opc, offset) if label is None: @@ -524,7 +515,6 @@ class Scanner3(Scanner): targets[label] = targets.get(label, []) + [offset] pass - extended_arg = 0 pass # for loop # DEBUG: diff --git a/uncompyle6/scanners/scanner36.py b/uncompyle6/scanners/scanner36.py index fa2b7a91..58a7daf0 100644 --- a/uncompyle6/scanners/scanner36.py +++ b/uncompyle6/scanners/scanner36.py @@ -75,12 +75,11 @@ class Scanner36(Scanner3): self.setup_loops = {} # setup_loop offset given target targets = {} - extended_arg = 0 for i, inst in enumerate(self.insts): offset = inst.offset op = inst.opcode - self.detect_control_flow(offset, targets, extended_arg) + self.detect_control_flow(offset, targets, 0) if inst.has_arg: label = self.fixed_jumps.get(offset) @@ -102,7 +101,6 @@ class Scanner36(Scanner3): targets[label] = targets.get(label, []) + [offset] pass - extended_arg = 0 pass # for loop # DEBUG: