Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa00e95

Browse files
committed
# In case BINARY_SUBSCR, use proper PyList_GET* macros instead of inlining.
1 parent 7859f87 commit fa00e95

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Python/ceval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,15 +849,15 @@ eval_code2(co, globals, locals,
849849
/* INLINE: list[int] */
850850
long i = PyInt_AsLong(w);
851851
if (i < 0)
852-
i += ((PyListObject*) v)->ob_size;
852+
i += PyList_GET_SIZE(v);
853853
if (i < 0 ||
854-
i >= ((PyListObject*) v)->ob_size) {
854+
i >= PyList_GET_SIZE(v)) {
855855
PyErr_SetString(PyExc_IndexError,
856856
"list index out of range");
857857
x = NULL;
858858
}
859859
else {
860-
x = ((PyListObject*) v)->ob_item[i];
860+
x = PyList_GET_ITEM(v, i);
861861
Py_INCREF(x);
862862
}
863863
}

0 commit comments

Comments
 (0)