You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Start to improve detect_structure for 2.7 and 2.x
Add debug flag to find_jump_targets to show the structure we found. When there are control-flow bugs, it's often reflected here. scanner3.py: make code make more similar to 2.x code
This commit is contained in:
@@ -428,6 +428,8 @@ class Scanner3(Scanner):
|
||||
# Containers filled by detect_structure()
|
||||
self.not_continue = set()
|
||||
self.return_end_ifs = set()
|
||||
self.setup_loop_targets = {} # target given setup_loop offset
|
||||
self.setup_loops = {} # setup_loop offset given target
|
||||
|
||||
targets = {}
|
||||
for offset in self.op_range(0, n):
|
||||
@@ -585,6 +587,8 @@ class Scanner3(Scanner):
|
||||
start = offset+3
|
||||
target = self.get_target(offset)
|
||||
end = self.restrict_to_parent(target, parent)
|
||||
self.setup_loop_targets[offset] = target
|
||||
self.setup_loops[target] = offset
|
||||
|
||||
if target != end:
|
||||
self.fixed_jumps[offset] = end
|
||||
|
Reference in New Issue
Block a user