You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Python 3.0 decompile bugs
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -15,6 +15,11 @@ class Python30Parser(Python3Parser):
|
|||||||
stmt ::= store_locals
|
stmt ::= store_locals
|
||||||
store_locals ::= LOAD_FAST STORE_LOCALS
|
store_locals ::= LOAD_FAST STORE_LOCALS
|
||||||
|
|
||||||
|
# FIXME: combine with parse3.2
|
||||||
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK
|
||||||
|
COME_FROM_LOOP
|
||||||
|
whileTruestmt ::= SETUP_LOOP return_stmts
|
||||||
|
COME_FROM_LOOP
|
||||||
|
|
||||||
# In many ways Python 3.0 code generation is more like Python 2.6 than
|
# In many ways Python 3.0 code generation is more like Python 2.6 than
|
||||||
# it is 2.7 or 3.1. So we have a number of 2.6ish (and before) rules below
|
# it is 2.7 or 3.1. So we have a number of 2.6ish (and before) rules below
|
||||||
|
@@ -322,7 +322,7 @@ class Scanner3(Scanner):
|
|||||||
if target <= inst.offset:
|
if target <= inst.offset:
|
||||||
next_opname = self.opname[self.code[inst.offset+3]]
|
next_opname = self.opname[self.code[inst.offset+3]]
|
||||||
if (inst.offset in self.stmts and
|
if (inst.offset in self.stmts and
|
||||||
#if (hasattr(inst, 'linestart') and
|
(self.version != 3.0 or (hasattr(inst, 'linestart'))) 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'))):
|
||||||
|
Reference in New Issue
Block a user