##// END OF EJS Templates
reachableroots: bail if integer object cannot be allocated...
Yuya Nishihara -
r26032:a3d5da8b default
parent child Browse files
Show More
@@ -1185,14 +1185,16 b' static PyObject *reachableroots(indexObj'
1185 1185 /* Add the node to reachable if it is a root*/
1186 1186 revnum = tovisit[k++];
1187 1187 val = PyInt_FromLong(revnum);
1188 if (val == NULL)
1189 goto bail;
1188 1190 if (PySet_Contains(roots, val) == 1) {
1189 1191 PySet_Add(reachable, val);
1190 1192 if (includepath == 0) {
1191 Py_XDECREF(val);
1193 Py_DECREF(val);
1192 1194 continue;
1193 1195 }
1194 1196 }
1195 Py_XDECREF(val);
1197 Py_DECREF(val);
1196 1198
1197 1199 /* Add its parents to the list of nodes to visit */
1198 1200 if (revnum != -1) {
@@ -1223,9 +1225,15 b' static PyObject *reachableroots(indexObj'
1223 1225 goto bail;
1224 1226 for (k = 0; k < 2; k++) {
1225 1227 PyObject *p = PyInt_FromLong(parents[k]);
1226 if (PySet_Contains(reachable, p) == 1)
1227 PySet_Add(reachable, PyInt_FromLong(i));
1228 Py_XDECREF(p);
1228 if (p == NULL)
1229 goto bail;
1230 if (PySet_Contains(reachable, p) == 1) {
1231 val = PyInt_FromLong(i);
1232 if (val == NULL)
1233 goto bail;
1234 PySet_Add(reachable, val);
1235 }
1236 Py_DECREF(p);
1229 1237 }
1230 1238 }
1231 1239 }
General Comments 0
You need to be logged in to leave comments. Login now