[all-commits] [llvm/llvm-project] 2a7b0f: [lldb] use the Py_REFCNT() macro instead of direct...

Charlie Li via All-commits all-commits at lists.llvm.org
Tue Mar 24 15:49:30 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a7b0f06d2060dbab8fa38fae7689f2d9048fa9d
      https://github.com/llvm/llvm-project/commit/2a7b0f06d2060dbab8fa38fae7689f2d9048fa9d
  Author: Charlie Li <git at vishwin.info>
  Date:   2026-03-24 (Tue, 24 Mar 2026)

  Changed paths:
    M lldb/bindings/python/python-wrapper.swig

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list