]> granicus.if.org Git - python/commit
Fix SF#1470508: crash in generator cycle finalization. There were two
authorPhillip J. Eby <pje@telecommunity.com>
Sat, 15 Apr 2006 01:02:17 +0000 (01:02 +0000)
committerPhillip J. Eby <pje@telecommunity.com>
Sat, 15 Apr 2006 01:02:17 +0000 (01:02 +0000)
commit8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39
tree066424b3c1e37a639145e6453cb4f7d1b83b41e1
parent3cfea2dc987b90e637c4cbd5db5dc1f542e448b2
Fix SF#1470508: crash in generator cycle finalization.  There were two
problems: first, PyGen_NeedsFinalizing() had an off-by-one bug that
prevented it from ever saying a generator didn't need finalizing, and
second, frame objects cleared themselves in a way that caused their
owning generator to think they were still executable, causing a double
deallocation of objects on the value stack if there was still a loop
on the block stack.  This revision also removes some unnecessary
close() operations from test_generators that are now appropriately
handled by the cycle collector.
Lib/test/test_generators.py
Objects/frameobject.c
Objects/genobject.c