summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-10-01 02:01:04 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-10-01 02:01:04 (GMT)
commit10c7e86454db59ece9d5ed028dd9d104ac766bdf (patch)
treee9508988b8cd5fc27a4711fd19310535a3606f9f /Lib
parentd6e0032768effca9e33cb6db9ce47e785541590f (diff)
downloadcpython-10c7e86454db59ece9d5ed028dd9d104ac766bdf.zip
cpython-10c7e86454db59ece9d5ed028dd9d104ac766bdf.tar.gz
cpython-10c7e86454db59ece9d5ed028dd9d104ac766bdf.tar.bz2
deque_traverse(): If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a NULL pointer in a release build. Reported on c.l.py by Stefan Behnel.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_deque.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index c0024ac..300e9af 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -324,6 +324,15 @@ class TestBasic(unittest.TestCase):
for s in ('abcd', xrange(2000)):
self.assertEqual(list(reversed(deque(s))), list(reversed(s)))
+ def test_gc_doesnt_blowup(self):
+ import gc
+ # This used to assert-fail in deque_traverse() under a debug
+ # build, or run wild with a NULL pointer in a release build.
+ d = deque()
+ for i in xrange(100):
+ d.append(1)
+ gc.collect()
+
def R(seqn):
'Regular generator'
for i in seqn: