◐ Shell
clean mode source ↗

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

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