Skip to content

Commit

Permalink
Fix incorrect error status handling
Browse files Browse the repository at this point in the history
  • Loading branch information
GrieferAtWork committed May 17, 2024
1 parent 3d4fd9b commit 9fee5f1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/deemon/objects/seq/default-api-mutable.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,13 @@ DeeSeq_DefaultPopWithError(DeeObject *self, Dee_ssize_t index) {
INTERN WUNUSED NONNULL((1, 2)) int DCALL
DeeSeq_DefaultRemoveWithTSCRemoveAll(DeeObject *self, DeeObject *item,
size_t start, size_t end) {
return (*DeeType_SeqCache_RequireRemoveAll(Dee_TYPE(self)))(self, item, start, end, 1);
size_t result;
result = (*DeeType_SeqCache_RequireRemoveAll(Dee_TYPE(self)))(self, item, start, end, 1);
if unlikely(result == (size_t)-1)
goto err;
return 0;
err:
return -1;
}

INTERN WUNUSED NONNULL((1, 2)) int DCALL
Expand Down Expand Up @@ -473,7 +479,13 @@ DeeSeq_DefaultRemoveWithError(DeeObject *self, DeeObject *item,
INTERN WUNUSED NONNULL((1, 2, 5)) int DCALL
DeeSeq_DefaultRemoveWithKeyWithTSCRemoveAllWithKey(DeeObject *self, DeeObject *item,
size_t start, size_t end, DeeObject *key) {
return (*DeeType_SeqCache_RequireRemoveAllWithKey(Dee_TYPE(self)))(self, item, start, end, 1, key);
size_t result;
result = (*DeeType_SeqCache_RequireRemoveAllWithKey(Dee_TYPE(self)))(self, item, start, end, 1, key);
if unlikely(result == (size_t)-1)
goto err;
return 0;
err:
return -1;
}

INTERN WUNUSED NONNULL((1, 2, 5)) int DCALL
Expand Down

0 comments on commit 9fee5f1

Please sign in to comment.