Logged In: YES
user_id=31435
Thanks, Armin! It's not ideal, but better than a crash for sure,
and nobody has had a better idea.
Doc/lib/libstdtypes.tex; new revision: 1.108
Lib/test/test_sort.py; new revision: 1.3
Lib/test/test_types.py; new revision: 1.39
Misc/NEWS; new revision: 1.520
Objects/listobject.c; new revision: 2.141
Note that I fiddled the patch to check ob_size > 0 at the end
too -- because we use realloc to grow space for lists, it was
possible for a comparison function to grow empty_ob_item in-
place, and then the mutation wasn't caught. Ditto if a whole
bunch of inserts and deletes managed to recycle memory in
such a way that malloc() just happened to return the same
address as empty_ob_item a second time. Those aren't
hypothetical, cuz I saw them happening when writing a test
case and wondering why it only caught the mutations *some*
of the times. I'm still not sure it's bulletproof mutation
detection, but the test case triggers every time now, so who
cares <wink>.
|