bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751)

This commit is contained in:
Serhiy Storchaka 2017-04-22 02:48:11 +03:00 committed by Victor Stinner
parent a36e939aeb
commit 1a5856bf92
4 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
#ifndef Py_LIMITED_API
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
#define PyList_GET_SIZE(op) Py_SIZE(op)
#define PyList_GET_SIZE(op) (assert(PyList_Check(op)),Py_SIZE(op))
#define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item)
#endif