Skip to content

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

@markshannon

Description

@markshannon

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

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions