mercurial/parsers.c
changeset 26017 44705659da94
parent 26016 c8d41c9c23c7
child 26018 c6115c30a376
equal deleted inserted replaced
26016:c8d41c9c23c7 26017:44705659da94
  1165 
  1165 
  1166 	/* Populate tovisit with all the heads */
  1166 	/* Populate tovisit with all the heads */
  1167 	numheads = PyList_GET_SIZE(heads);
  1167 	numheads = PyList_GET_SIZE(heads);
  1168 	for (i = 0; i < numheads; i++) {
  1168 	for (i = 0; i < numheads; i++) {
  1169 		revnum = PyInt_AS_LONG(PyList_GET_ITEM(heads, i));
  1169 		revnum = PyInt_AS_LONG(PyList_GET_ITEM(heads, i));
       
  1170 		if (revnum + 1 < 0 || revnum + 1 >= len + 1) {
       
  1171 			PyErr_SetString(PyExc_IndexError, "head out of range");
       
  1172 			goto bail;
       
  1173 		}
  1170 		if (seen[revnum+1] == 0) {
  1174 		if (seen[revnum+1] == 0) {
  1171 			tovisit[lentovisit++] = revnum;
  1175 			tovisit[lentovisit++] = revnum;
  1172 			seen[revnum+1]=1;
  1176 			seen[revnum+1]=1;
  1173 		}
  1177 		}
  1174 	}
  1178 	}