You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Fix for RETURN_END_IF bug
This commit is contained in:
@@ -48,3 +48,6 @@ def func_with_tuple_args5((a,b), (c,d), *args, **kwargs):
|
||||
def func_with_tuple_args6((a,b), (c,d)=(2,3), *args, **kwargs):
|
||||
print a
|
||||
print c
|
||||
|
||||
def func_ret1():
|
||||
return 1 < 2 < 3
|
@@ -822,17 +822,13 @@ class Scanner25(scan.Scanner):
|
||||
'start': rtarget,
|
||||
'end': end})
|
||||
elif code[pre[rtarget]] == RETURN_VALUE:
|
||||
# if it's an old JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP (return 1<2<3 case)
|
||||
if pos < rtarget and code[rtarget] == ROT_TWO:
|
||||
return
|
||||
self.structs.append({'type': 'if-then',
|
||||
'start': start,
|
||||
'end': rtarget})
|
||||
self.return_end_ifs.add(pre[rtarget])
|
||||
# if it's an old JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP
|
||||
#if target > pos:
|
||||
# unop_target = self.last_instr(pos, target, JF, target)
|
||||
# if unop_target and code[unop_target+3] != ROT_TWO:
|
||||
# self.fixed_jumps[pos] = unop_target
|
||||
# else:
|
||||
# self.fixed_jumps[pos] = self.restrict_to_parent(target, parent)
|
||||
|
||||
def find_jump_targets(self, code):
|
||||
'''
|
||||
|
@@ -821,17 +821,13 @@ class Scanner26(scan.Scanner):
|
||||
'start': rtarget,
|
||||
'end': end})
|
||||
elif code[pre[rtarget]] == RETURN_VALUE:
|
||||
# if it's an old JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP (return 1<2<3 case)
|
||||
if pos < rtarget and code[rtarget] == ROT_TWO:
|
||||
return
|
||||
self.structs.append({'type': 'if-then',
|
||||
'start': start,
|
||||
'end': rtarget})
|
||||
self.return_end_ifs.add(pre[rtarget])
|
||||
# if it's an old JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP
|
||||
#if target > pos:
|
||||
# unop_target = self.last_instr(pos, target, JF, target)
|
||||
# if unop_target and code[unop_target+3] != ROT_TWO:
|
||||
# self.fixed_jumps[pos] = unop_target
|
||||
# else:
|
||||
# self.fixed_jumps[pos] = self.restrict_to_parent(target, parent)
|
||||
|
||||
def find_jump_targets(self, code):
|
||||
'''
|
||||
|
Reference in New Issue
Block a user