You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
Python 3.5 continue detection bug
This commit is contained in:
@@ -39,8 +39,11 @@ class Python35Parser(Python34Parser):
|
|||||||
return_if_stmt ::= ret_expr RETURN_END_IF POP_BLOCK
|
return_if_stmt ::= ret_expr RETURN_END_IF POP_BLOCK
|
||||||
|
|
||||||
ifelsestmtc ::= testexpr c_stmts_opt JUMP_FORWARD else_suitec
|
ifelsestmtc ::= testexpr c_stmts_opt JUMP_FORWARD else_suitec
|
||||||
|
ifelsestmtc ::= testexpr c_stmts_opt jf_else else_suitec
|
||||||
|
|
||||||
# ifstmt ::= testexpr c_stmts_opt
|
# ifstmt ::= testexpr c_stmts_opt
|
||||||
|
|
||||||
|
iflaststmt ::= testexpr c_stmts_opt JUMP_FORWARD
|
||||||
|
|
||||||
# Python 3.3+ also has yield from. 3.5 does it
|
# Python 3.3+ also has yield from. 3.5 does it
|
||||||
# differently than 3.3, 3.4
|
# differently than 3.3, 3.4
|
||||||
|
@@ -324,11 +324,12 @@ class Scanner3(Scanner):
|
|||||||
if (inst.offset in self.stmts and
|
if (inst.offset in self.stmts and
|
||||||
(next_opname not in ('END_FINALLY', 'POP_BLOCK',
|
(next_opname not in ('END_FINALLY', 'POP_BLOCK',
|
||||||
# Python 3.0 only uses POP_TOP
|
# Python 3.0 only uses POP_TOP
|
||||||
'POP_TOP')
|
'POP_TOP'))):
|
||||||
and inst.offset not in self.not_continue) or
|
if (self.version == 3.5 or
|
||||||
(tokens[-1].type == 'RETURN_VALUE' and
|
(inst.offset not in self.not_continue) or
|
||||||
self.version < 3.5)):
|
(tokens[-1].type == 'RETURN_VALUE')):
|
||||||
opname = 'CONTINUE'
|
opname = 'CONTINUE'
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
opname = 'JUMP_BACK'
|
opname = 'JUMP_BACK'
|
||||||
# FIXME: this is a hack to catch stuff like:
|
# FIXME: this is a hack to catch stuff like:
|
||||||
|
Reference in New Issue
Block a user