Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7660b880
Commit
7660b880
authored
Jun 24, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index)
parent
9a644b23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Objects/listobject.c
Objects/listobject.c
+3
-3
Objects/tupleobject.c
Objects/tupleobject.c
+2
-2
No files found.
Objects/listobject.c
View file @
7660b880
...
...
@@ -2660,7 +2660,7 @@ PyTypeObject PyList_Type = {
typedef
struct
{
PyObject_HEAD
long
it_index
;
Py_ssize_t
it_index
;
PyListObject
*
it_seq
;
/* Set to NULL when iterator is exhausted */
}
listiterobject
;
...
...
@@ -2797,7 +2797,7 @@ listiter_reduce(listiterobject *it)
static
PyObject
*
listiter_setstate
(
listiterobject
*
it
,
PyObject
*
state
)
{
long
index
=
PyLong_AsLong
(
state
);
Py_ssize_t
index
=
PyLong_AsSsize_t
(
state
);
if
(
index
==
-
1
&&
PyErr_Occurred
())
return
NULL
;
if
(
it
->
it_seq
!=
NULL
)
{
...
...
@@ -2958,7 +2958,7 @@ listiter_reduce_general(void *_it, int forward)
if
(
forward
)
{
listiterobject
*
it
=
(
listiterobject
*
)
_it
;
if
(
it
->
it_seq
)
return
Py_BuildValue
(
"N(O)
l
"
,
_PyObject_GetBuiltin
(
"iter"
),
return
Py_BuildValue
(
"N(O)
n
"
,
_PyObject_GetBuiltin
(
"iter"
),
it
->
it_seq
,
it
->
it_index
);
}
else
{
listreviterobject
*
it
=
(
listreviterobject
*
)
_it
;
...
...
Objects/tupleobject.c
View file @
7660b880
...
...
@@ -988,7 +988,7 @@ static PyObject *
tupleiter_reduce
(
tupleiterobject
*
it
)
{
if
(
it
->
it_seq
)
return
Py_BuildValue
(
"N(O)
l
"
,
_PyObject_GetBuiltin
(
"iter"
),
return
Py_BuildValue
(
"N(O)
n
"
,
_PyObject_GetBuiltin
(
"iter"
),
it
->
it_seq
,
it
->
it_index
);
else
return
Py_BuildValue
(
"N(())"
,
_PyObject_GetBuiltin
(
"iter"
));
...
...
@@ -997,7 +997,7 @@ tupleiter_reduce(tupleiterobject *it)
static
PyObject
*
tupleiter_setstate
(
tupleiterobject
*
it
,
PyObject
*
state
)
{
Py_ssize_t
index
=
PyLong_As
Long
(
state
);
Py_ssize_t
index
=
PyLong_As
Ssize_t
(
state
);
if
(
index
==
-
1
&&
PyErr_Occurred
())
return
NULL
;
if
(
it
->
it_seq
!=
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment