You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
dectect_structure() -> detect_control_flow()
This commit is contained in:
@@ -478,7 +478,7 @@ class Scanner2(scan.Scanner):
|
|||||||
elif op in self.setup_ops:
|
elif op in self.setup_ops:
|
||||||
count_SETUP_ += 1
|
count_SETUP_ += 1
|
||||||
|
|
||||||
def detect_structure(self, offset, op):
|
def detect_control_flow(self, offset, op):
|
||||||
"""
|
"""
|
||||||
Detect type of block structures and their boundaries to fix optimized jumps
|
Detect type of block structures and their boundaries to fix optimized jumps
|
||||||
in python2.3+
|
in python2.3+
|
||||||
@@ -955,7 +955,7 @@ class Scanner2(scan.Scanner):
|
|||||||
self.ignore_if = set()
|
self.ignore_if = set()
|
||||||
self.build_statement_indices()
|
self.build_statement_indices()
|
||||||
|
|
||||||
# Containers filled by detect_structure()
|
# Containers filled by detect_control_flow()
|
||||||
self.not_continue = set()
|
self.not_continue = set()
|
||||||
self.return_end_ifs = set()
|
self.return_end_ifs = set()
|
||||||
self.setup_loop_targets = {} # target given setup_loop offset
|
self.setup_loop_targets = {} # target given setup_loop offset
|
||||||
@@ -968,7 +968,7 @@ class Scanner2(scan.Scanner):
|
|||||||
|
|
||||||
# Determine structures and fix jumps in Python versions
|
# Determine structures and fix jumps in Python versions
|
||||||
# since 2.3
|
# since 2.3
|
||||||
self.detect_structure(offset, op)
|
self.detect_control_flow(offset, op)
|
||||||
|
|
||||||
if op_has_argument(op, self.opc):
|
if op_has_argument(op, self.opc):
|
||||||
label = self.fixed_jumps.get(offset)
|
label = self.fixed_jumps.get(offset)
|
||||||
|
@@ -441,7 +441,7 @@ class Scanner3(Scanner):
|
|||||||
self.build_statement_indices()
|
self.build_statement_indices()
|
||||||
self.else_start = {}
|
self.else_start = {}
|
||||||
|
|
||||||
# Containers filled by detect_structure()
|
# Containers filled by detect_control_flow()
|
||||||
self.not_continue = set()
|
self.not_continue = set()
|
||||||
self.return_end_ifs = set()
|
self.return_end_ifs = set()
|
||||||
self.setup_loop_targets = {} # target given setup_loop offset
|
self.setup_loop_targets = {} # target given setup_loop offset
|
||||||
@@ -453,7 +453,7 @@ class Scanner3(Scanner):
|
|||||||
|
|
||||||
# Determine structures and fix jumps in Python versions
|
# Determine structures and fix jumps in Python versions
|
||||||
# since 2.3
|
# since 2.3
|
||||||
self.detect_structure(offset, targets)
|
self.detect_control_flow(offset, targets)
|
||||||
|
|
||||||
has_arg = (op >= op3.HAVE_ARGUMENT)
|
has_arg = (op >= op3.HAVE_ARGUMENT)
|
||||||
if has_arg:
|
if has_arg:
|
||||||
@@ -580,7 +580,7 @@ class Scanner3(Scanner):
|
|||||||
|
|
||||||
return target
|
return target
|
||||||
|
|
||||||
def detect_structure(self, offset, targets):
|
def detect_control_flow(self, offset, targets):
|
||||||
"""
|
"""
|
||||||
Detect structures and their boundaries to fix optimized jumps
|
Detect structures and their boundaries to fix optimized jumps
|
||||||
in python2.3+
|
in python2.3+
|
||||||
|
Reference in New Issue
Block a user