Skip to content

Commit abbe448

Browse files
authored
PyUnicode_KIND() uses _Py_RVALUE() (#100060)
The PyUnicode_KIND() macro is modified to use _Py_RVALUE(), so it can no longer be used as a l-value.
1 parent 679efbb commit abbe448

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/cpython/unicodeobject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ enum PyUnicode_Kind {
231231
// new compiler warnings on "kind < PyUnicode_KIND(str)" (compare signed and
232232
// unsigned numbers) where kind type is an int or on
233233
// "unsigned int kind = PyUnicode_KIND(str)" (cast signed to unsigned).
234-
#define PyUnicode_KIND(op) (_PyASCIIObject_CAST(op)->state.kind)
234+
#define PyUnicode_KIND(op) _Py_RVALUE(_PyASCIIObject_CAST(op)->state.kind)
235235

236236
/* Return a void pointer to the raw unicode buffer. */
237237
static inline void* _PyUnicode_COMPACT_DATA(PyObject *op) {

0 commit comments

Comments
 (0)