llvm-project
2a7b0f06 - [lldb] use the Py_REFCNT() macro instead of directly accessing member (#188161)

Commit
26 days ago
[lldb] use the Py_REFCNT() macro instead of directly accessing member (#188161) [PyObject members are not to be accessed directly](https://docs.python.org/3/c-api/structures.html#c.PyObject), but rather through macros, in this case `Py_REFCNT()`. In most, ie Global Interpreter Lock-enabled, CPython cases, `Py_REFCNT()` expands to accessing `ob_refcnt` anyway. However, in a free-threaded CPython, combined with disabling the limited API (since it requires the GIL for now), the direct member does not exist, causing the build to fail. The macro expands to the correct access method in the free-threaded configuration.
Author
Parents
Loading