You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
More bugs found via sre_parse.py decompilation
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,7 +9,8 @@ def readline (self):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# From 2.4.6 sre.py
|
# From 2.4.6 sre.py
|
||||||
# Bug in 2.4 and 2.3 was parsing the nested "while 1" with a "break" in it
|
# Bug has to do with "break" not being recognized
|
||||||
|
# and is a JUMP_FORWARD.
|
||||||
def _parse(a, b, source, state):
|
def _parse(a, b, source, state):
|
||||||
while 1:
|
while 1:
|
||||||
if b:
|
if b:
|
||||||
@@ -17,3 +18,29 @@ def _parse(a, b, source, state):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def _parse2(source, state):
|
||||||
|
while 1:
|
||||||
|
if a:
|
||||||
|
if b:
|
||||||
|
while 1:
|
||||||
|
this = 1
|
||||||
|
break
|
||||||
|
continue
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
if b:
|
||||||
|
break
|
||||||
|
|
||||||
|
x = 3
|
||||||
|
|
||||||
|
# Bug was in 2.3 decompilation
|
||||||
|
def _parse3(source, state):
|
||||||
|
while 1:
|
||||||
|
if a:
|
||||||
|
if b:
|
||||||
|
x = 1
|
||||||
|
while 1:
|
||||||
|
if a:
|
||||||
|
break
|
||||||
|
raise
|
||||||
|
@@ -45,6 +45,8 @@ class Python23Parser(Python24Parser):
|
|||||||
# a "break" inside "l_stmts".
|
# a "break" inside "l_stmts".
|
||||||
while1stmt ::= _while1test l_stmts COME_FROM JUMP_BACK
|
while1stmt ::= _while1test l_stmts COME_FROM JUMP_BACK
|
||||||
POP_TOP POP_BLOCK COME_FROM
|
POP_TOP POP_BLOCK COME_FROM
|
||||||
|
while1stmt ::= _while1test l_stmts JUMP_BACK
|
||||||
|
POP_TOP POP_BLOCK
|
||||||
|
|
||||||
list_comp ::= BUILD_LIST_0 DUP_TOP LOAD_ATTR store list_iter del_stmt
|
list_comp ::= BUILD_LIST_0 DUP_TOP LOAD_ATTR store list_iter del_stmt
|
||||||
list_for ::= expr for_iter store list_iter JUMP_BACK come_froms POP_TOP JUMP_BACK
|
list_for ::= expr for_iter store list_iter JUMP_BACK come_froms POP_TOP JUMP_BACK
|
||||||
|
@@ -43,6 +43,8 @@ class Python24Parser(Python25Parser):
|
|||||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK
|
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK
|
||||||
POP_TOP POP_BLOCK
|
POP_TOP POP_BLOCK
|
||||||
|
|
||||||
|
continue ::= JUMP_BACK JUMP_ABSOLUTE
|
||||||
|
|
||||||
# Python 2.4
|
# Python 2.4
|
||||||
# The following has no "JUMP_BACK" after l_stmts because
|
# The following has no "JUMP_BACK" after l_stmts because
|
||||||
# l_stmts ends in a "break", "return", or "continue"
|
# l_stmts ends in a "break", "return", or "continue"
|
||||||
|
Reference in New Issue
Block a user