mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
d6e0032768
commit
10c7e86454
2 changed files with 22 additions and 10 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue