while1 bug in 2.6 and 2.7

This commit is contained in:
rocky
2016-07-07 13:07:16 -04:00
parent 21314c1dad
commit 06023c247d
6 changed files with 12 additions and 2 deletions

View File

@@ -145,7 +145,6 @@ class Python26Parser(Python2Parser):
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK
else_suite COME_FROM
while1stmt ::= SETUP_LOOP return_stmts bp_come_from
return_stmt ::= ret_expr RETURN_END_IF come_from_pop

View File

@@ -50,6 +50,8 @@ class Python27Parser(Python2Parser):
withasstmt ::= expr SETUP_WITH designator suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM
WITH_CLEANUP END_FINALLY
while1stmt ::= SETUP_LOOP l_stmts POP_BLOCK COME_FROM
"""

View File

@@ -439,7 +439,7 @@ class Scanner2(scan.Scanner):
# Is jump back really "back"?
jump_target = self.get_target(jump_back, code[jump_back])
if (jump_target > jump_back or
code[jump_back+3] == self.opc.JUMP_FORWARD):
code[jump_back+3] in [self.opc.JUMP_FORWARD, self.opc.JUMP_ABSOLUTE]):
jump_back = None
pass
else: