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
b77c6c65
Commit
b77c6c65
authored
Sep 12, 2011
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases.
parent
4165bfb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Objects/longobject.c
Objects/longobject.c
+3
-3
No files found.
Objects/longobject.c
View file @
b77c6c65
...
@@ -525,8 +525,8 @@ PyLong_AsUnsignedLong(PyObject *vv)
...
@@ -525,8 +525,8 @@ PyLong_AsUnsignedLong(PyObject *vv)
return
x
;
return
x
;
}
}
/* Get a C
unsigned long int from a long int object.
/* Get a C
size_t from a long int object. Returns (size_t)-1 and sets
Returns -1 and sets
an error condition if overflow occurs. */
an error condition if overflow occurs. */
size_t
size_t
PyLong_AsSize_t
(
PyObject
*
vv
)
PyLong_AsSize_t
(
PyObject
*
vv
)
...
@@ -562,7 +562,7 @@ PyLong_AsSize_t(PyObject *vv)
...
@@ -562,7 +562,7 @@ PyLong_AsSize_t(PyObject *vv)
if
((
x
>>
PyLong_SHIFT
)
!=
prev
)
{
if
((
x
>>
PyLong_SHIFT
)
!=
prev
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"Python int too large to convert to C size_t"
);
"Python int too large to convert to C size_t"
);
return
(
unsigned
long
)
-
1
;
return
(
size_t
)
-
1
;
}
}
}
}
return
x
;
return
x
;
...
...
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