mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
ceval.c's GETITEM should have asserts, not set exceptions (GH-96518)
This commit is contained in:
parent
9e55685782
commit
ac18665472
1 changed files with 8 additions and 2 deletions
|
@ -733,9 +733,15 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
/* Tuple access macros */
|
||||
|
||||
#ifndef Py_DEBUG
|
||||
#define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i))
|
||||
#define GETITEM(v, i) PyTuple_GET_ITEM((v), (i))
|
||||
#else
|
||||
#define GETITEM(v, i) PyTuple_GetItem((v), (i))
|
||||
static inline PyObject *
|
||||
GETITEM(PyObject *v, Py_ssize_t i) {
|
||||
assert(PyTuple_Check(v));
|
||||
assert(i >= 0);
|
||||
assert(i < PyTuple_GET_SIZE(v));
|
||||
return PyTuple_GET_ITEM(v, i);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Code access macros */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue