]> granicus.if.org Git - python/commit
_PyTuple_Resize(): this dumped core on tuple(globals()) for me. Turns
authorGuido van Rossum <guido@python.org>
Fri, 7 Dec 2001 20:00:04 +0000 (20:00 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 7 Dec 2001 20:00:04 +0000 (20:00 +0000)
commitf70590f990e6b91c36c3aadd7da6fa6c0a9a5beb
treeaddcf11e7e8ea18da0d684fd7e10b8ebded86214
parentc6259d73c225e659e00bb861ffb38b7878ab3f1a
_PyTuple_Resize(): this dumped core on tuple(globals()) for me.  Turns
out the for loop at the end intended to zero out new items wasn't
doing anything, because sv->ob_size was already equal to newsize.  The
fix slightly refactors the function, introducing a variable oldsize
and doing away with sizediff (which was used only once), and using
oldsize and newsize consistently.  I also added comments explaining
what the two for loops do.  (Looking at the CVS annotation of this
function, it's no miracle a bug crept in -- this has been patched by
many different folks! :-)
Objects/tupleobject.c