]> granicus.if.org Git - python/commitdiff
# In case BINARY_SUBSCR, use proper PyList_GET* macros instead of inlining.
authorGuido van Rossum <guido@python.org>
Wed, 8 Jul 1998 15:02:37 +0000 (15:02 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 8 Jul 1998 15:02:37 +0000 (15:02 +0000)
Python/ceval.c

index d81f3fd8d9c455cc1768b41d551c189e8bbc2530..4331786aa71d60acf780817047cac75471d6bd0d 100644 (file)
@@ -849,15 +849,15 @@ eval_code2(co, globals, locals,
                                /* INLINE: list[int] */
                                long i = PyInt_AsLong(w);
                                if (i < 0)
-                                       i += ((PyListObject*) v)->ob_size;
+                                       i += PyList_GET_SIZE(v);
                                if (i < 0 ||
-                                   i >= ((PyListObject*) v)->ob_size) {
+                                   i >= PyList_GET_SIZE(v)) {
                                        PyErr_SetString(PyExc_IndexError,
                                                "list index out of range");
                                        x = NULL;
                                }
                                else {
-                                       x = ((PyListObject*) v)->ob_item[i];
+                                       x = PyList_GET_ITEM(v, i);
                                        Py_INCREF(x);
                                }
                        }