• Guido van Rossum's avatar
    Fix a subtle bug in the trashcan code I added yesterday to · 0906e074
    Guido van Rossum yazdı
    subtype_dealloc().
    
    When call_finalizer() failed, it would return without going through
    the trashcan end macro, thereby unbalancing the trashcan nesting level
    counter, and thereby defeating the test case (slottrash() in
    test_descr.py).  This in turn meant that the assert in the GC_UNTRACK
    macro wasn't triggered by the slottrash() test despite a bug in the
    code: _PyTrash_destroy_chain() calls the dealloc routine with an
    object that's untracked, and the assert in the GC_UNTRACK macro would
    fail on this; but because of an earlier test that resurrects an
    object, causing call_finalizer() to fail and the trashcan nesting
    level to be unbalanced, so _PyTrash_destroy_chain() was never called.
    Calling the slottrash() test in isolation *did* trigger the assert,
    however.
    
    So the fix is twofold: (1) call the GC_UnTrack() function instead of
    the GC_UNTRACK macro, because the function is safe when the object is
    already untracked; (2) when call_finalizer() fails, jump to a label
    that exits through the trashcan end macro, keeping the trashcan
    nesting balanced.
    0906e074
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...