[C++-sig] Re: args patch
Nikolay Mladenov
nickm at sitius.com
Sat Aug 2 21:43:15 CEST 2003
David Abrahams wrote:
>
> 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!
Yeah, I don't remember if the things have been different when I wrote
this or
I have just imagined that I can end up with min_arity < n_args <
max_arity.
I guess I have meant to copy arg2 -> arg3
> > ! PyTuple_SET_ITEM(args3.get(), l, PyTuple_GET_ITEM(args2.get(), l) );
But anyway it seems really unreachable now.
>
> 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.
>
I like it better. Please apply it.
Nikolay
More information about the Cplusplus-sig
mailing list