Skip to content

Reference count leak when there is an error in the BUILD_MAP opcode #109216

Closed
@timofej673

Description

@timofej673

Bug report

Bug description:

        inst(BUILD_MAP, (values[oparg*2] -- map)) {
            map = _PyDict_FromItems(
                    values, 2,
                    values+1, 2,
                    oparg);
            if (map == NULL)     <--------------
                goto error; <------------------

            DECREF_INPUTS();
            ERROR_IF(map == NULL, error);
        }

If an error occurs, the number of links will not decrease

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