Skip to content

Crash on invalid type parameter bound expression in conditional block #145187

@StanFromIreland

Description

@StanFromIreland

Crash report

What happened?

Found by the cpython3 fuzzer, see https://oss-fuzz.com/testcase-detail/5164455094976512.

>>> try:a
... finally:
...  class h[l:{7for*()in 0}]:2
python: Python/compile.c:1163: _PyCompile_LeaveConditionalBlock: Assertion `c->u->u_in_conditional_block > 0' failed.
            Aborted (core dumped)

I think I know how to fix it, I will open a PR.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions