Commit d09403de authored by Tim Peters's avatar Tim Peters

Changed the uses of PER_CHANGED() that weren't checking the result for

an error return.
parent 1f988334
......@@ -12,7 +12,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.42 2002/06/11 02:37:57 tim_one Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.43 2002/06/11 02:59:05 tim_one Exp $\n"
/*
** _BTree_get
......@@ -111,7 +111,8 @@ BTree_split(BTree *self, int index, BTree *next)
Py_XINCREF(next->firstbucket);
}
PER_CHANGED(self);
if (PER_CHANGED(self) < 0)
return -1;
return 0;
}
......
......@@ -12,7 +12,7 @@
****************************************************************************/
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.38 2002/06/09 05:56:25 tim_one Exp $\n"
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.39 2002/06/11 02:59:05 tim_one Exp $\n"
/* Use BUCKET_SEARCH to find the index at which a key belongs.
* INDEX An int lvalue to hold the index i such that KEY belongs at
......@@ -440,7 +440,8 @@ bucket_split(Bucket *self, int index, Bucket *next)
Py_INCREF(next);
self->next = next;
PER_CHANGED(self);
if (PER_CHANGED(self) < 0)
return -1;
return 0;
}
......@@ -459,21 +460,23 @@ Bucket_nextBucket(Bucket *self, Bucket **r)
static int
Bucket_deleteNextBucket(Bucket *self)
{
int result = -1; /* until proven innocent */
PER_USE_OR_RETURN(self, -1);
if (self->next)
{
Bucket *n;
if (Bucket_nextBucket(self->next, &n) < 0) goto err;
if (Bucket_nextBucket(self->next, &n) < 0) goto Done;
ASSIGNB(self->next, n);
PER_CHANGED(self);
if (PER_CHANGED(self) < 0)
goto Done;
}
result = 0;
Done:
PER_ALLOW_DEACTIVATION(self);
PER_ACCESSED(self);
return 0;
err:
PER_ALLOW_DEACTIVATION(self);
PER_ACCESSED(self);
return -1;
return result;
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment