Skip to content

Refactor codegen_deferred_annotations_body to ensure mangled is decref'd #148059

@A0su

Description

@A0su

Bug report

Bug description:

Follow-up item from this PR: #146443 (review)

During error cases we may fail to decref mangled while using these ADDOP* and VISIT macros. As a result, we can extract the for loop's body into a subfunction that we check the return of and decref mangled if needed.

        // NOTE: ref of mangled can be leaked on ADDOP* and VISIT macros due to early returns
        // fixing would require an overhaul of these macros

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    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