[Python-checkins] python/dist/src/Python bltinmodule.c,2.288,2.289

Alex Martelli aleax@aleax.it
Tue, 22 Apr 2003 11:25:18 +0200


On Tuesday 22 April 2003 11:13 am, Raymond Hettinger wrote:
> > Update of /cvsroot/python/python/dist/src/Python
> > In directory sc8-pr-cvs1:/tmp/cvs-serv22004/src/Python
> >
> > Modified Files:
> > bltinmodule.c
> > Log Message:
> > Adding new built-in function sum, with docs and tests.
>
> The ref counts for "result" may be hosed.
> The passed-in reference is borrowed, but the one
> created by PyInt_FromLong() is a new reference.
> If one of the decrefs hits the borrowed reference,
> the ref count may go negative.

Absolutely true, thanks!  Fixed it and committed the fix.


Alex