[C++-sig] Re: args patch

David Abrahams dave at boost-consulting.com
Fri Aug 1 16:16:37 CEST 2003


Nikolay Mladenov <nickm at sitius.com> writes:

> Diffs to the cvs from before couple of days:

Hi Nikolay,

In future, please post patches as unified diffs (you can use cvs diff
-wu).

This patch appears to have some significant bogus code in it,
especially in function.cpp.  Just for example, I think the following
block would never be entered:

> !                             //adjust the parameter tuple size
> !                             if(j<max_arity)
> !                             {
> !                                 handle<> args3( PyTuple_New(j) );
> ! 
> !                                 for (size_t l = 0; l != j; ++ l)
> !                                 {
> !                                     PyTuple_SET_ITEM(args3.get(), l, PyTuple_GET_ITEM(args3.get(), l) );
> !                                     PyTuple_SET_ITEM(args2.get(), l, 0);
> !                                 }
> !                                 args2 = args3;
> !                             }
>                           }
>                       }
>                   }

It had better not be, because it is getting all the elements of args3
and putting them back there!

I've enclosed the modified patch which seems to be working on my
machine.  I had to rename lots of variables in order to make sense of
things.  Please look it over to make sure it makes sense to you.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nikolay.patch
Type: text/x-patch
Size: 10857 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030801/4032e716/attachment.bin>
-------------- next part --------------


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


More information about the Cplusplus-sig mailing list