diff --git a/src/deemon/objects/list.c b/src/deemon/objects/list.c index 2084c538e..b45d82d91 100644 --- a/src/deemon/objects/list.c +++ b/src/deemon/objects/list.c @@ -2756,6 +2756,8 @@ list_find(List *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : list_find_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; @@ -2774,6 +2776,8 @@ list_rfind(List *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : list_rfind_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; diff --git a/src/deemon/objects/seq/default-api-methods.c b/src/deemon/objects/seq/default-api-methods.c index 8d401a86e..848b88c8c 100644 --- a/src/deemon/objects/seq/default-api-methods.c +++ b/src/deemon/objects/seq/default-api-methods.c @@ -2595,6 +2595,8 @@ generic_seq_find(DeeObject *self, size_t argc, DeeObject *const *argv, DeeObject : new_DeeSeqFind(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; @@ -2613,6 +2615,8 @@ generic_seq_rfind(DeeObject *self, size_t argc, DeeObject *const *argv, DeeObjec : new_DeeSeqRFind(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; diff --git a/src/deemon/objects/seq/svec.c b/src/deemon/objects/seq/svec.c index e8b2bcc87..e9a45cc96 100644 --- a/src/deemon/objects/seq/svec.c +++ b/src/deemon/objects/seq/svec.c @@ -1244,6 +1244,8 @@ svec_find(SharedVector *self, size_t argc, DeeObject *const *argv, DeeObject *kw : svec_find_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; @@ -1262,6 +1264,8 @@ svec_rfind(SharedVector *self, size_t argc, DeeObject *const *argv, DeeObject *k : svec_rfind_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; diff --git a/src/deemon/objects/tuple.c b/src/deemon/objects/tuple.c index 44bdcc10d..df52a8664 100644 --- a/src/deemon/objects/tuple.c +++ b/src/deemon/objects/tuple.c @@ -1939,6 +1939,8 @@ tuple_find(Tuple *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : tuple_find_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; @@ -1957,6 +1959,8 @@ tuple_rfind(Tuple *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : tuple_rfind_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; diff --git a/src/dex/collections/fixedlist.c b/src/dex/collections/fixedlist.c index d6ebcf935..7656c6bca 100644 --- a/src/dex/collections/fixedlist.c +++ b/src/dex/collections/fixedlist.c @@ -1407,6 +1407,8 @@ fl_find(FixedList *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : fl_find_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL; @@ -1425,6 +1427,8 @@ fl_rfind(FixedList *self, size_t argc, DeeObject *const *argv, DeeObject *kw) { : fl_rfind_impl(self, item, start, end); if unlikely(result == (size_t)Dee_COMPARE_ERR) goto err; + if unlikely(result == (size_t)-1) + return_reference_(DeeInt_MinusOne); return DeeInt_NewSize(result); err: return NULL;