[Python-checkins] cpython (3.1): Fix obscure set crashers (#8420). Backport of d56b3cafb1e6, reviewed by (original) (raw)

eric.araujo python-checkins at python.org
Wed Mar 23 04:53:53 CET 2011


http://hg.python.org/cpython/rev/57657393ceaf changeset: 68860:57657393ceaf branch: 3.1 parent: 68852:6853b480e388 user: Éric Araujo <merwok at netwok.org> date: Wed Mar 23 02:08:07 2011 +0100 summary: Fix obscure set crashers (#8420). Backport of d56b3cafb1e6, reviewed by Raymond.

files: Lib/test/test_set.py Objects/setobject.c

diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1660,6 +1660,39 @@ self.assertRaises(TypeError, getattr(set('january'), methname), N(data)) self.assertRaises(ZeroDivisionError, getattr(set('january'), methname), E(data))

+class bad_eq:

@@ -1804,6 +1837,7 @@ TestIdentities, TestVariousIteratorArgs, TestGraphs,

diff --git a/Objects/setobject.c b/Objects/setobject.c --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -364,12 +364,14 @@ set_add_entry(register PySetObject *so, setentry *entry) { register Py_ssize_t n_used;

@@ -657,11 +661,13 @@ } for (i = 0; i <= other->mask; i++) { entry = &other->table[i];

@@ -1642,15 +1648,22 @@ while (_PyDict_Next(other, &pos, &key, &value, &hash)) { setentry an_entry;

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



More information about the Python-checkins mailing list