From 0f56b4f476d88abd1ed8592bc7ec1315c2182113 Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 20 Nov 2016 03:21:03 -0500 Subject: [PATCH] Add debug option on Python 3 find_jump_targets() --- uncompyle6/scanners/scanner3.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index c955a3ae..c8ae4926 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -199,7 +199,7 @@ class Scanner3(Scanner): # Get jump targets # Format: {target offset: [jump offsets]} - jump_targets = self.find_jump_targets() + jump_targets = self.find_jump_targets(show_asm) for inst in bytecode: @@ -401,7 +401,7 @@ class Scanner3(Scanner): for _ in range(self.op_size(op)): self.prev_op.append(offset) - def find_jump_targets(self): + def find_jump_targets(self, debug): """ Detect all offsets in a byte code which are jump targets where we might insert a COME_FROM instruction. @@ -457,6 +457,13 @@ class Scanner3(Scanner): elif op == self.opc.END_FINALLY and offset in self.fixed_jumps: label = self.fixed_jumps[offset] targets[label] = targets.get(label, []) + [offset] + pass + pass + # DEBUG: + if debug in ('both', 'after'): + import pprint as pp + pp.pprint(self.structs) + return targets def build_statement_indices(self):