Skip to content

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

Closed

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

Activity

  1. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Feb 24, 2026
  2. added a commit that references this issue on Feb 24, 2026
  3. added a commit that references this issue on Feb 24, 2026
  4. gpshead commented on Feb 24, 2026

    @gpshead
    Member

    i could reproduce it on debug builds of 3.14 but not 3.13 so I triggered the 3.14 backport. thanks for the fix!

  5. added a commit that references this issue on Feb 24, 2026
  6. added a commit that references this issue on Feb 28, 2026
  7. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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