Skip to content

instrumentation.c: Use-after-Py_DECREF comparison in call_one_instrument #151524

@lpyu001

Description

@lpyu001

Bug report

Bug description:

Summary

At line 992-993, Py_DECREF(res) then res compared to &_PyInstrumentation_DISABLE. Using a potentially-freed pointer in comparison is UB per C standard.

This is a sub-issue of #146102 with gist details

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions