From 7bae15cf37239d4d345e09cc318bd82d03ec30cd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 28 Nov 2022 17:42:22 +0100 Subject: Use _Py_RVALUE() in macros (#99844) The following macros are modified to use _Py_RVALUE(), so they can no longer be used as l-value: * DK_LOG_SIZE() * _PyCode_CODE() * _PyList_ITEMS() * _PyTuple_ITEMS() * _Py_SLIST_HEAD() * _Py_SLIST_ITEM_NEXT() _PyCode_CODE() is private and other macros are part of the internal C API. --- Include/cpython/code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Include/cpython') diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 15b464fe2e..fd57e0035b 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -153,7 +153,7 @@ static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) { return op->co_nfreevars; } -#define _PyCode_CODE(CO) ((_Py_CODEUNIT *)(CO)->co_code_adaptive) +#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive) #define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT)) /* Public interface */ -- cgit v1.2.1