Skip to content
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

RETURN instruction can be missing line number in except* #125845

Open
markshannon opened this issue Oct 22, 2024 · 2 comments
Open

RETURN instruction can be missing line number in except* #125845

markshannon opened this issue Oct 22, 2024 · 2 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@markshannon
Copy link
Member

markshannon commented Oct 22, 2024

Bug report

Bug description:

If the check in all_exits_have_lineno (flowgraph.c:520) is changed from instr->i_opcode == RETURN_VALUE to
instr->i_opcode == RETURN_VALUE || instr->i_opcode == RETURN_CONST then test_sys_settrace will fail with an assert.

The function triggering the assert is this:

def func():
    try:
        try:
            raise ValueError(3)
        except* TypeError:
            5
    except ValueError:
        7

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

@markshannon markshannon added the type-bug An unexpected behavior, bug, or error label Oct 22, 2024
@markshannon
Copy link
Member Author

FYI, I'm planning on removing RETURN_CONST, which is how I discovered this. #125837

@iritkatriel
Copy link
Member

If this is blocking you, feel free to comment out the assertion and leave a comment pointing to this issue.

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

No branches or pull requests

2 participants