cpython/Lib/test/test_cext
Victor Stinner 0dc1a96026
[3.15] gh-161185: Fix strict aliasing issue in Py_SETREF() macros family (#161186) (#161360)
gh-161185: Fix strict aliasing issue in Py_SETREF() macros family (#161186)

Py_SETREF(), Py_XSETREF() and Py_CLEAR() now use memcpy() to set
_tmp_old_dst/_tmp_old_op to fix a strict aliasing issue.

Py_SETREF(), Py_XSETREF() and Py_CLEAR() now also cast
_tmp_old_dst/_tmp_old_op to PyObject* when calling
Py_DECREF()/Py_XDECREF() to avoid compiler warnings with the limited
C API.

Add the _Py_TESTCEXT_NO_TYPEOF macro to undefine the _Py_TYPEOF
macro.


(cherry picked from commit f8e65ee35d)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2026-11-04 22:10:34 +00:00
..
__init__.py [3.15] gh-161185: Fix strict aliasing issue in Py_SETREF() macros family (#161186) (#161360) 2026-11-04 22:10:34 +00:00
extension.c [3.15] gh-161185: Fix strict aliasing issue in Py_SETREF() macros family (#161186) (#161360) 2026-11-04 22:10:34 +00:00
extension.cpp [3.15] gh-157649: Merge test_cppext into test_cext (#158176) (#159264) 2026-10-13 00:21:22 +02:00
runtests.py [3.15] gh-157649: Use more warmups in test_cext to check for refleaks (#159374) 2026-10-14 00:09:55 +02:00
setup.py [3.15] gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ (#159315) 2026-10-13 13:32:16 +00:00