[Python-Dev] New bug in listobject.c

Tim Peters tim.one at comcast.net
Thu Aug 14 22:29:34 EDT 2003


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.




More information about the Python-Dev mailing list