Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

while if continue return sequence #32

Open
rocky opened this issue Feb 4, 2018 · 0 comments
Open

while if continue return sequence #32

rocky opened this issue Feb 4, 2018 · 0 comments

Comments

@rocky
Copy link

rocky commented Feb 4, 2018

Decompiling bytecode for:

def test(a):
    while True:
        if a:
            pass
        else:
            continue
        return

gives:

:Traceback (most recent call last):
  File "/src/external-vcs/github/uncompyle2/uncompyle2/__init__.py", line 203, in main
    uncompyle_file(infile, outstream, showasm, showast)
  File "/src/external-vcs/github/uncompyle2/uncompyle2/__init__.py", line 140, in uncompyle_file
    uncompyle(version, co, outstream, showasm, showast)
  File "/src/external-vcs/github/uncompyle2/uncompyle2/__init__.py", line 129, in uncompyle
    raise walk.ERROR
ParserError: --- This code section failed: ---

0	SETUP_LOOP        '26'
3	LOAD_GLOBAL       'True'
6	POP_JUMP_IF_FALSE '25'

9	LOAD_FAST         'a'
12	POP_JUMP_IF_FALSE '3'

15	JUMP_FORWARD      '21'

18	CONTINUE          '3'
21_0	COME_FROM         '15'

21	LOAD_CONST        None
24	RETURN_END_IF     None
25	POP_BLOCK         None
26_0	COME_FROM         '0'

Syntax error at or near `POP_BLOCK' token at offset 25

That RETURN_END_IF in fact is not the end of the if/else which ends after the continue instruction on line 18.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant