Skip to content

[3.9] bpo-42057: Fix peephole optimizer #22802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2020
Merged

Conversation

methane
Copy link
Member

@methane methane commented Oct 20, 2020

@methane methane added the type-bug An unexpected behavior, bug, or error label Oct 20, 2020
@methane methane requested a review from markshannon October 20, 2020 02:45
@markshannon
Copy link
Member

Looks good.
Could you add the following test to test_peepholer.py

def test_42057():
    for i in range(10):
         try:
             raise Exception
         except Exception or Exception:
             pass

Putting the try-except in a loop causes a consistent crash due to stack underflow.

@methane methane merged commit 07a44d9 into python:3.9 Oct 22, 2020
@methane methane deleted the bpo-42057 branch October 22, 2020 02:06
@methane
Copy link
Member Author

methane commented Oct 22, 2020

Oh, I'm sorrry. I forget to push the requested test case.

@methane
Copy link
Member Author

methane commented Oct 22, 2020

Ah! I had pushed it to python/cpython repository instead of my fork.

@methane
Copy link
Member Author

methane commented Oct 22, 2020

#22878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants