[Python-checkins] cpython: Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators:

victor.stinner python-checkins at python.org
Tue Jun 4 23:03:11 CEST 2013


http://hg.python.org/cpython/rev/757a121a27c2
changeset:   84021:757a121a27c2
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Jun 04 23:02:46 2013 +0200
summary:
  Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators:
change the C type of seqiterobject.it_index from long to Py_ssize_t.

files:
  Misc/NEWS            |  3 +++
  Objects/iterobject.c |  2 +-
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 Core and Builtins
 -----------------
 
+- Issue #17932: Fix an integer overflow issue on Windows 64-bit in iterators:
+  change the C type of seqiterobject.it_index from long to Py_ssize_t.
+
 - Issue #18065: Don't set __path__ to the package name for frozen packages.
 
 - Issue #18088: When reloading a module, unconditionally reset all relevant
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -4,7 +4,7 @@
 
 typedef struct {
     PyObject_HEAD
-    long      it_index;
+    Py_ssize_t it_index;
     PyObject *it_seq; /* Set to NULL when iterator is exhausted */
 } seqiterobject;
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list