Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(30426)

Unified Diff: Objects/abstract.c

Issue 14010: deeply nested filter segfaults
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Modules/itertoolsmodule.c ('k') | Python/bltinmodule.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Objects/abstract.c Tue Mar 19 13:27:24 2013 +0200
+++ b/Objects/abstract.c Tue Mar 19 20:08:58 2013 +0200
@@ -1238,7 +1238,7 @@
to be an int or have an __int__ method. Steals integral's
reference. error_format will be used to create the TypeError if integral
isn't actually an Integral instance. error_format should be a format string
- that can accept a char* naming integral's type.
+ that can accept a char* naming integral's type.
*/
static PyObject *
convert_integral_to_int(PyObject *integral, const char *error_format)
@@ -1257,7 +1257,7 @@
}
PyErr_Format(PyExc_TypeError, error_format, Py_TYPE(integral)->tp_name);
Py_DECREF(integral);
- return NULL;
+ return NULL;
}
@@ -2702,7 +2702,10 @@
PyIter_Next(PyObject *iter)
{
PyObject *result;
+ if (Py_EnterRecursiveCall(" while iterating"))
+ return NULL;
result = (*iter->ob_type->tp_iternext)(iter);
+ Py_LeaveRecursiveCall();
if (result == NULL &&
PyErr_Occurred() &&
PyErr_ExceptionMatches(PyExc_StopIteration))
« no previous file with comments | « Modules/itertoolsmodule.c ('k') | Python/bltinmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+