##// END OF EJS Templates
revlog: handle errors from index_node() in nt_insert() and index_slice_del()...
Martin von Zweigbergk -
r38020:51460577 default
parent child Browse files
Show More
@@ -1068,10 +1068,12 b' static int nt_insert(indexObject *self, '
1068 return 0;
1068 return 0;
1069 }
1069 }
1070 if (v < 0) {
1070 if (v < 0) {
1071 const char *oldnode = index_node(self, -(v + 1));
1071 const char *oldnode = index_node_existing(self, -(v + 1));
1072 int noff;
1072 int noff;
1073
1073
1074 if (!oldnode || !memcmp(oldnode, node, 20)) {
1074 if (oldnode == NULL)
1075 return -1;
1076 if (!memcmp(oldnode, node, 20)) {
1075 n->children[k] = -rev - 1;
1077 n->children[k] = -rev - 1;
1076 return 0;
1078 return 0;
1077 }
1079 }
@@ -1850,10 +1852,11 b' static int index_slice_del(indexObject *'
1850 Py_ssize_t i;
1852 Py_ssize_t i;
1851
1853
1852 for (i = start + 1; i < self->length - 1; i++) {
1854 for (i = start + 1; i < self->length - 1; i++) {
1853 const char *node = index_node(self, i);
1855 const char *node = index_node_existing(self, i);
1856 if (node == NULL)
1857 return -1;
1854
1858
1855 if (node)
1859 nt_insert(self, node, -1);
1856 nt_insert(self, node, -1);
1857 }
1860 }
1858 if (self->added)
1861 if (self->added)
1859 nt_invalidate_added(self, 0);
1862 nt_invalidate_added(self, 0);
General Comments 0
You need to be logged in to leave comments. Login now