Skip to content

flowgraph optimize_cfg Assertion for if-else-expression with if-else-expression as condition #109889

Closed

Description

@15r10nk

Bug report

Bug description:

a if (1 if b else c) else d

output (Python 3.12.0rc3+):

python: Python/flowgraph.c:1598: optimize_cfg: Assertion `no_redundant_nops(g)' failed.

tested with the current 3.12 branch (538f505)

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Activity

  1. AA-Turner commented on Sep 26, 2023

    @AA-Turner
    Member
  2. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    type-crashA hard crash of the interpreter, possibly with a core dump
    3.12only security fixes
    3.13only security fixes
    on Sep 26, 2023
  3. iritkatriel commented on Sep 26, 2023

    @iritkatriel
    Member

    The optimizer removes NOPs which are redundant (don't have important line number info attached). But there is a bug where it misses the case where there is a basic block that contains a single such NOP (and nothing else).

    This is not a correctness issue, it's only an optimization failing. I will make a PR for 3.12 to just remove the assertion. In 3.13 I will fix this optimization.

  4. iritkatriel commented on Sep 26, 2023

    @iritkatriel
    Member

    I will make a PR for 3.12 to just remove the assertion. In 3.13 I will fix this optimization.

    I mean remove the assertion in 3.12.0. We can fix in 3.12.1.

  5. added a commit that references this issue on Sep 26, 2023
  6. added a commit that references this issue on Sep 26, 2023
  7. added 5 commits that reference this issue on Sep 27, 2023
  8. added a commit that references this issue on Sep 28, 2023
  9. added a commit that references this issue on Sep 28, 2023
  10. added a commit that references this issue on Sep 29, 2023
  11. added a commit that references this issue on Oct 2, 2023
  12. added a commit that references this issue on Sep 2, 2024
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

    3.12only security fixes3.13only security fixesinterpreter-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