From 9fee5f1a0e6f0cb07334d644199178c0dd172212 Mon Sep 17 00:00:00 2001 From: GrieferAtWork Date: Fri, 17 May 2024 21:12:54 +0200 Subject: [PATCH] Fix incorrect error status handling --- src/deemon/objects/seq/default-api-mutable.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/deemon/objects/seq/default-api-mutable.c b/src/deemon/objects/seq/default-api-mutable.c index 7d9228471..58d557c72 100644 --- a/src/deemon/objects/seq/default-api-mutable.c +++ b/src/deemon/objects/seq/default-api-mutable.c @@ -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 @@ -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