You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Bugs found in 2.4 branch testing
This commit is contained in:
BIN
test/bytecode_2.3/08_while1_if_continue.pyc
Normal file
BIN
test/bytecode_2.3/08_while1_if_continue.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,3 +7,13 @@ def readline (self):
|
||||
continue
|
||||
|
||||
return
|
||||
|
||||
# From 2.4.6 sre.py
|
||||
# Bug in 2.4 and 2.3 was parsing the nested "while 1" with a "break" in it
|
||||
def _parse(a, b, source, state):
|
||||
while 1:
|
||||
if b:
|
||||
while 1:
|
||||
break
|
||||
else:
|
||||
raise
|
||||
|
@@ -32,8 +32,19 @@ class Python23Parser(Python24Parser):
|
||||
while1stmt ::= _while1test l_stmts_opt JUMP_BACK
|
||||
POP_TOP POP_BLOCK COME_FROM
|
||||
|
||||
while1stmt ::= _while1test l_stmts_opt JUMP_BACK
|
||||
COME_FROM POP_TOP POP_BLOCK COME_FROM
|
||||
while1stmt ::= _while1test l_stmts_opt JUMP_BACK COME_FROM
|
||||
POP_TOP POP_BLOCK COME_FROM
|
||||
|
||||
# Python 2.3
|
||||
# The following has no "JUMP_BACK" after l_stmts because
|
||||
# l_stmts ends in a "break", "return", or "continue"
|
||||
while1stmt ::= _while1test l_stmts
|
||||
POP_TOP POP_BLOCK
|
||||
|
||||
# The following has a "COME_FROM" at the end which comes from
|
||||
# a "break" inside "l_stmts".
|
||||
while1stmt ::= _while1test l_stmts COME_FROM JUMP_BACK
|
||||
POP_TOP POP_BLOCK COME_FROM
|
||||
|
||||
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
|
||||
|
@@ -38,8 +38,21 @@ class Python24Parser(Python25Parser):
|
||||
_ifstmts_jump24 ::= c_stmts_opt JUMP_FORWARD POP_TOP
|
||||
|
||||
# Python 2.5+ omits POP_TOP POP_BLOCK
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK
|
||||
POP_TOP POP_BLOCK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK
|
||||
POP_TOP POP_BLOCK
|
||||
|
||||
# Python 2.4
|
||||
# The following has no "JUMP_BACK" after l_stmts because
|
||||
# l_stmts ends in a "break", "return", or "continue"
|
||||
while1stmt ::= SETUP_LOOP l_stmts
|
||||
POP_TOP POP_BLOCK
|
||||
|
||||
# The following has a "COME_FROM" at the end which comes from
|
||||
# a "break" inside "l_stmts".
|
||||
while1stmt ::= SETUP_LOOP l_stmts COME_FROM JUMP_BACK
|
||||
POP_TOP POP_BLOCK COME_FROM
|
||||
|
||||
# Python 2.5+:
|
||||
# call_stmt ::= expr POP_TOP
|
||||
|
Reference in New Issue
Block a user