You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
JUMP_IF_{TRUE,FALSE}_OR_OP fixes
This commit is contained in:
@@ -37,7 +37,7 @@ entry_points={
|
||||
]}
|
||||
ftp_url = None
|
||||
install_requires = ['spark-parser >= 1.4.0',
|
||||
'xdis >= 1.1.2']
|
||||
'xdis >= 1.1.3']
|
||||
license = 'MIT'
|
||||
mailing_list = 'python-debugger@googlegroups.com'
|
||||
modname = 'uncompyle6'
|
||||
|
@@ -22,6 +22,8 @@ class Python26Parser(Python2Parser):
|
||||
JUMP_IF_FALSE POP_TOP POP_TOP designator POP_TOP
|
||||
try_middle ::= JUMP_FORWARD COME_FROM except_stmts
|
||||
POP_TOP END_FINALLY come_froms
|
||||
try_middle ::= JUMP_FORWARD COME_FROM except_stmts
|
||||
COME_FROM POP_TOP END_FINALLY come_froms
|
||||
try_middle ::= JUMP_FORWARD COME_FROM except_stmts
|
||||
END_FINALLY come_froms
|
||||
try_middle ::= jmp_abs COME_FROM except_stmts
|
||||
@@ -71,6 +73,13 @@ class Python26Parser(Python2Parser):
|
||||
lc_body ::= LOAD_NAME expr LIST_APPEND
|
||||
'''
|
||||
|
||||
def p_ret26(self, args):
|
||||
'''
|
||||
ret_cond ::= expr jmp_false expr RETURN_END_IF COME_FROM POP_TOP ret_expr_or_cond
|
||||
ret_or ::= expr jmp_true ret_expr_or_cond COME_FROM
|
||||
'''
|
||||
|
||||
|
||||
class Python26ParserSingle(Python2Parser, PythonParserSingle):
|
||||
pass
|
||||
|
||||
|
@@ -701,11 +701,8 @@ class Scanner2(scan.Scanner):
|
||||
if op in self.opc.hasjrel and op != self.opc.FOR_ITER:
|
||||
label = i + 3 + oparg
|
||||
elif self.version == 2.7 and op in self.opc.hasjabs:
|
||||
if op in (self.opc.JUMP_IF_FALSE_OR_POP, self.opc.JUMP_IF_TRUE_OR_POP):
|
||||
if (oparg > i):
|
||||
label = oparg
|
||||
elif self.version < 2.7 and op in self.opc.hasjabs:
|
||||
if op in (self.opc.JUMP_IF_FALSE, self.opc.JUMP_IF_TRUE):
|
||||
if op in (self.opc.JUMP_IF_FALSE_OR_POP,
|
||||
self.opc.JUMP_IF_TRUE_OR_POP):
|
||||
if (oparg > i):
|
||||
label = oparg
|
||||
|
||||
|
Reference in New Issue
Block a user