[Python-Dev] New bug in listobject.c

Michael Hudson mwh at python.net
Fri Aug 15 12:50:41 EDT 2003


"Tim Peters" <tim.one at comcast.net> writes:

> list_ass_slice() currently looks like:
>
> ...
> 	int n; /* Size of replacement list */
> 	int d; /* Change in size */
> 	int k; /* Loop index */
> #define b ((PyListObject *)v)
> 	if (v == NULL)
> 		n = 0;
> 	else {
> 		char msg[256];
> 		if (a == b) {
> 			/* Special case "a[i:j] = a" -- copy b first */
> 			int ret;
> 			v = list_slice(b, 0, n);
>
> MSVC complains that n can be used before initialization in the last line.
> Looks like a fair complaint to me!  SF ViewCVS doesn't show this code, so it
> must be very new.

My fault.  Will fix momentarily.

Cheers,
mwh

-- 
  NUTRIMAT:  That drink was individually tailored to meet your
             personal requirements for nutrition and pleasure.
    ARTHUR:  Ah.  So I'm a masochist on a diet am I?
                    -- The Hitch-Hikers Guide to the Galaxy, Episode 9



More information about the Python-Dev mailing list