mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-45476: Disallow using asdl_seq_GET() as l-value (GH-29866)
The following internal macros can not longer be used as l-value: * asdl_seq_GET() * asdl_seq_GET_UNTYPED() * asdl_seq_LEN() They are modified to use the _Py_RVALUE() macro.
This commit is contained in:
parent
c19c3a0961
commit
4b97d974ec
1 changed files with 3 additions and 3 deletions
|
@ -78,9 +78,9 @@ asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *a
|
|||
return seq; \
|
||||
}
|
||||
|
||||
#define asdl_seq_GET_UNTYPED(S, I) (S)->elements[(I)]
|
||||
#define asdl_seq_GET(S, I) (S)->typed_elements[(I)]
|
||||
#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
|
||||
#define asdl_seq_GET_UNTYPED(S, I) _Py_RVALUE((S)->elements[(I)])
|
||||
#define asdl_seq_GET(S, I) _Py_RVALUE((S)->typed_elements[(I)])
|
||||
#define asdl_seq_LEN(S) _Py_RVALUE(((S) == NULL ? 0 : (S)->size))
|
||||
|
||||
#ifdef Py_DEBUG
|
||||
# define asdl_seq_SET(S, I, V) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue