python-goto icon indicating copy to clipboard operation
python-goto copied to clipboard

breaking from inner loop crashes python

Open igolotin opened this issue 4 years ago • 0 comments

Code to reproduce:

from goto import with_goto

content = ["ab", "cd"]
prefix = ['a', 'b']

@with_goto
def test():
    for a in content:
        print(f"1: {a}")
        for p in prefix:
            print(f"2: {a}")
            goto .end
        label .end
        print(f"3: {a}")

Expected output for the test() call:

1: ab
2: ab
3: ab
1: ab
2: ab
3: ab

Actually python crashes with a segmentation fault

Version:

python: Python 3.9.7

OS: windows x64

Some thoughts: That error seems have the same origin as #38

I put at as separate issue since it has slightly different reproducing code and should be tested separately

igolotin avatar Oct 27 '21 18:10 igolotin