summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_dict.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-28 16:42:22 (GMT)
committerGitHub <noreply@github.com>2022-11-28 16:42:22 (GMT)
commit7bae15cf37239d4d345e09cc318bd82d03ec30cd (patch)
tree578f5942b8a43b9720cf02bb5d35e7cd4d3926c6 /Include/internal/pycore_dict.h
parent65417988a589e6edfeada83227a8b0884a64af4f (diff)
downloadcpython-7bae15cf37239d4d345e09cc318bd82d03ec30cd.zip
cpython-7bae15cf37239d4d345e09cc318bd82d03ec30cd.tar.gz
cpython-7bae15cf37239d4d345e09cc318bd82d03ec30cd.tar.bz2
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.
Diffstat (limited to 'Include/internal/pycore_dict.h')
-rw-r--r--Include/internal/pycore_dict.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/internal/pycore_dict.h b/Include/internal/pycore_dict.h
index 04b7084..2b3b56b 100644
--- a/Include/internal/pycore_dict.h
+++ b/Include/internal/pycore_dict.h
@@ -122,7 +122,7 @@ struct _dictvalues {
PyObject *values[1];
};
-#define DK_LOG_SIZE(dk) ((dk)->dk_log2_size)
+#define DK_LOG_SIZE(dk) _Py_RVALUE((dk)->dk_log2_size)
#if SIZEOF_VOID_P > 4
#define DK_SIZE(dk) (((int64_t)1)<<DK_LOG_SIZE(dk))
#else