projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81e2659
)
Strange control flow in PyInt_AsLong. When nb_int is called inside
author
Thomas Heller
<theller@ctypes.org>
Thu, 20 Feb 2003 20:32:11 +0000
(20:32 +0000)
committer
Thomas Heller
<theller@ctypes.org>
Thu, 20 Feb 2003 20:32:11 +0000
(20:32 +0000)
the PyInt_AsLong function, and this returns a long, the value is first
retrieved with PyLong_AsLong, but afterwards overwritten by a call to
PyInt_AS_LONG.
Fixes SF #690253.
Objects/intobject.c
patch
|
blob
|
history
diff --git
a/Objects/intobject.c
b/Objects/intobject.c
index fee7e4e38deac67f911f327f42aef2488354eac8..611aedf9f46c3a38ce8e3824ec53c0ee0236e1ce 100644
(file)
--- a/
Objects/intobject.c
+++ b/
Objects/intobject.c
@@
-162,10
+162,10
@@
PyInt_AsLong(register PyObject *op)
if (PyLong_Check(io)) {
/* got a long? => retry int conversion */
val = PyLong_AsLong((PyObject *)io);
- if (PyErr_Occurred()) {
- Py_DECREF(io);
+ Py_DECREF(io);
+ if ((val == -1) && PyErr_Occurred())
return -1;
- }
+ return val;
}
else
{