Skip to content

Commit dba6d24

Browse files
committed
3.8 for block without a POP_BLOCK ...
and confusing JUMP_BACK for CONTINUE. Expect more like this. Fixes #293
1 parent 0b111f1 commit dba6d24

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

test/bytecode_3.8/01_for_continue.pyc

157 Bytes
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Bug is turning a JUMP_BACK for a CONTINUE so for has no JUMP_BACK.
2+
# Also there is no POP_BLOCK since there isn't anything in the loop.
3+
# In the future when we have better control flow, we might redo all of this.
4+
for i in range(2):
5+
pass

uncompyle6/parsers/parse38.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def p_38misc(self, args):
9292
for38 ::= expr get_iter store for_block JUMP_BACK
9393
for38 ::= expr for_iter store for_block JUMP_BACK
9494
for38 ::= expr for_iter store for_block JUMP_BACK POP_BLOCK
95+
for38 ::= expr for_iter store for_block
9596
9697
forelsestmt38 ::= expr for_iter store for_block POP_BLOCK else_suite
9798
forelselaststmt38 ::= expr for_iter store for_block POP_BLOCK else_suitec

0 commit comments

Comments
 (0)