Skip to content

Commit

Permalink
Refactor compare invocation API
Browse files Browse the repository at this point in the history
Use names that are more distinct from the new unified compare operators.
  • Loading branch information
GrieferAtWork committed May 5, 2024
1 parent 7bd6974 commit 03b1cc6
Show file tree
Hide file tree
Showing 66 changed files with 516 additions and 516 deletions.
2 changes: 1 addition & 1 deletion cpp.hint
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@
#define DEFINE_MATH_OPERATOR2(n,...) DEFINE_OPERATOR(DeeObject*,n,(DeeObject*self,DeeObject*some_object)){}
#define DEFINE_MATH_INPLACE_OPERATOR2(n,...) DEFINE_OPERATOR(int,n,(DeeObject**p_self,DeeObject*some_object)){}
#define DEFINE_OBJECT_COMPARE_OPERATOR(n,...) DEFINE_OPERATOR(DeeObject*,n,(DeeObject*self,DeeObject*some_object)){}
#define DEFINE_COMPARE_OPERATOR(n,...) int n(DeeObject*self,DeeObject*some_object){}
#define DEFINE_COMPARE_ASBOOL_OPERATOR(n,...) int n(DeeObject*self,DeeObject*some_object){}
#define DEFINE_TYPEOPREATORITEARTOR_COMPARE(n,...) DeeObject*n(TypeOperatorsIterator*self,TypeOperatorsIterator*other){}
#define DEE_DEFINE_BYTEWRITER_PUTX(n,T,x) int n(struct Dee_bytewriter*self,T x){}
#define DEE_DEFINE_ATOMIC_HELPERS(n,T) \
Expand Down
24 changes: 12 additions & 12 deletions include/deemon/cxx/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -1804,32 +1804,32 @@ class CxxIteratorBase {
bool operator==(CxxIteratorBase const &right) const {
return !right.it_iter
? it_next == ITER_DONE
: throw_if_negative(DeeObject_CompareEq(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpEqAsBool(it_iter, right.it_iter)) != 0;
}
bool operator!=(CxxIteratorBase const &right) const {
return !right.it_iter
? it_next != ITER_DONE
: throw_if_negative(DeeObject_CompareNe(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpNeAsBool(it_iter, right.it_iter)) != 0;
}
bool operator<(CxxIteratorBase const &right) const {
return !right.it_iter
? it_next != ITER_DONE
: throw_if_negative(DeeObject_CompareLo(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpLoAsBool(it_iter, right.it_iter)) != 0;
}
bool operator<=(CxxIteratorBase const &right) const {
return !right.it_iter
? true
: throw_if_negative(DeeObject_CompareLe(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpLeAsBool(it_iter, right.it_iter)) != 0;
}
bool operator>(CxxIteratorBase const &right) const {
return !right.it_iter
? false
: throw_if_negative(DeeObject_CompareGr(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpGrAsBool(it_iter, right.it_iter)) != 0;
}
bool operator>=(CxxIteratorBase const &right) const {
return !right.it_iter
? it_next == ITER_DONE
: throw_if_negative(DeeObject_CompareGe(it_iter, right.it_iter)) != 0;
: throw_if_negative(DeeObject_CmpGeAsBool(it_iter, right.it_iter)) != 0;
}
CxxIteratorBase &operator=(CxxIteratorBase &&right) DEE_CXX_NOTHROW {
Dee_XDecref(it_iter);
Expand Down Expand Up @@ -2981,22 +2981,22 @@ class Object
}

WUNUSED Ref<Object> operator==(DeeObject *other) {
return inherit(DeeObject_CompareEqObject(this, other));
return inherit(DeeObject_CmpEq(this, other));
}
WUNUSED Ref<Object> operator!=(DeeObject *other) {
return inherit(DeeObject_CompareNeObject(this, other));
return inherit(DeeObject_CmpNe(this, other));
}
WUNUSED Ref<Object> operator<(DeeObject *other) {
return inherit(DeeObject_CompareLoObject(this, other));
return inherit(DeeObject_CmpLo(this, other));
}
WUNUSED Ref<Object> operator<=(DeeObject *other) {
return inherit(DeeObject_CompareLeObject(this, other));
return inherit(DeeObject_CmpLe(this, other));
}
WUNUSED Ref<Object> operator>(DeeObject *other) {
return inherit(DeeObject_CompareGrObject(this, other));
return inherit(DeeObject_CmpGr(this, other));
}
WUNUSED Ref<Object> operator>=(DeeObject *other) {
return inherit(DeeObject_CompareGeObject(this, other));
return inherit(DeeObject_CmpGe(this, other));
}

/* Integer conversion */
Expand Down
2 changes: 1 addition & 1 deletion include/deemon/dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ DeeDict_NewKeyItemsInherited(size_t num_keyitems,
* >> break; // Not found
* >> if (item->di_hash != hash)
* >> continue; // Non-matching hash
* >> if (DeeObject_TryCompareForEquality(key, item->di_key) == 0)
* >> if (DeeObject_TryCompareEq(key, item->di_key) == 0)
* >> return item->di_item;
* >> }
* >> return NULL;
Expand Down
2 changes: 1 addition & 1 deletion include/deemon/hashset.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ DeeHashSet_NewItemsInherited(size_t num_items,
* >> break; // Not found
* >> if (item->hsi_hash != hash)
* >> continue; // Non-matching hash
* >> if (DeeObject_TryCompareForEquality(key, item->hsi_key) == 0)
* >> if (DeeObject_TryCompareEq(key, item->hsi_key) == 0)
* >> return item->si_item;
* >> }
* >> return NULL;
Expand Down
34 changes: 17 additions & 17 deletions include/deemon/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -4482,28 +4482,28 @@ DFUNDEF WUNUSED NONNULL((1)) int (DCALL DeeObject_InplaceXorUInt32)(DREF DeeObje


/* Comparison operator invocation. */
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareEqObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareNeObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareLoObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareLeObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareGrObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CompareGeObject)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpEq)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpNe)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpLo)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpLe)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpGr)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_CmpGe)(DeeObject *self, DeeObject *some_object);

/* Same as above, but automatically cast the returned object using `DeeObject_Bool()' */
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareEq)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareNe)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareLo)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareLe)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareGr)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CompareGe)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpEqAsBool)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpNeAsBool)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpLoAsBool)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpLeAsBool)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpGrAsBool)(DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_CmpGeAsBool)(DeeObject *self, DeeObject *some_object);


/* Deprecated wrapper around "DeeObject_TryCompareForEquality()"
/* Deprecated wrapper around "DeeObject_TryCompareEq()"
* @return: 1 : Compare returns "true"
* @return: 0 : Compare returns "false"
* @return: -1: Error */
DFUNDEF WUNUSED NONNULL((1, 2)) int
(DCALL DeeObject_TryCompareEq)(DeeObject *self, DeeObject *some_object); /* DEPRECATED! */
(DCALL DeeObject_TryCmpEqAsBool)(DeeObject *self, DeeObject *some_object); /* DEPRECATED! */

/* @return: == -1: `lhs < rhs'
* @return: == 0: `lhs == rhs'
Expand All @@ -4517,9 +4517,9 @@ DFUNDEF WUNUSED NONNULL((1, 2)) int
* @return: == 1: `lhs != rhs'
* @return: == Dee_COMPARE_ERR: An error occurred. */
DFUNDEF WUNUSED NONNULL((1, 2)) int
(DCALL DeeObject_CompareForEquality)(DeeObject *lhs, DeeObject *rhs);
(DCALL DeeObject_CompareEq)(DeeObject *lhs, DeeObject *rhs);

/* Same as `DeeObject_CompareForEquality()', but automatically handles errors
/* Same as `DeeObject_CompareEq()', but automatically handles errors
* that usually indicate that "lhs" and "rhs" cannot be compared by returning
* either `-1' or `1' instead. The following errors get handled (so-long as
* the effective `tp_trycompare_eq' callback doesn't end up throwing these):
Expand All @@ -4531,7 +4531,7 @@ DFUNDEF WUNUSED NONNULL((1, 2)) int
* @return: == 1: `lhs != rhs'
* @return: == Dee_COMPARE_ERR: An error occurred. */
DFUNDEF WUNUSED NONNULL((1, 2)) int
(DCALL DeeObject_TryCompareForEquality)(DeeObject *lhs, DeeObject *rhs);
(DCALL DeeObject_TryCompareEq)(DeeObject *lhs, DeeObject *rhs);

/* Compare a pre-keyed `lhs_keyed' with `rhs' using the given (optional) `key' function
* @return: == -1: `lhs_keyed < key(rhs)'
Expand Down
18 changes: 9 additions & 9 deletions include/deemon/super.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TInplaceOr)(DeeTypeObjec
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TInplaceXor)(DeeTypeObject *tp_self, DREF DeeObject **__restrict p_self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TInplacePow)(DeeTypeObject *tp_self, DREF DeeObject **__restrict p_self, DeeObject *some_object);

DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareEqObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareNeObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareLoObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareLeObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareGrObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCompareGeObject)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int DCALL DeeObject_TCompare(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int DCALL DeeObject_TCompareForEquality(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int DCALL DeeObject_TTryCompareForEquality(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpEq)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpNe)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpLo)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpLe)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpGr)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *(DCALL DeeObject_TCmpGe)(DeeTypeObject *tp_self, DeeObject *self, DeeObject *some_object);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TCompare)(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TCompareEq)(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TTryCompareEq)(DeeTypeObject *tp_lhs, DeeObject *lhs, DeeObject *rhs);

DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TForeach)(DeeTypeObject *tp_self, DeeObject *self, Dee_foreach_t proc, void *arg);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TForeachPair)(DeeTypeObject *tp_self, DeeObject *self, Dee_foreach_pair_t proc, void *arg);
Expand Down
2 changes: 1 addition & 1 deletion src/deemon/compiler/asm/assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,7 @@ asm_newconst(DeeObject *__restrict constvalue) {
for (i = 0; i < count; ++i) {
elem = vec[i];
if (Dee_TYPE(elem) == Dee_TYPE(constvalue)) {
int error = DeeObject_TryCompareForEquality(constvalue, elem);
int error = DeeObject_TryCompareEq(constvalue, elem);
if unlikely(error == Dee_COMPARE_ERR)
goto err;
if (error == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/deemon/compiler/optimize/assumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ same_constant_value(DeeObject *__restrict a,
return true;
if (Dee_TYPE(a) != Dee_TYPE(b))
return false;
temp = DeeObject_TryCompareForEquality(a, b);
temp = DeeObject_TryCompareEq(a, b);
if unlikely(temp == Dee_COMPARE_ERR)
DeeError_Handled(ERROR_HANDLED_RESTORE);
return temp == 0;
Expand Down
2 changes: 1 addition & 1 deletion src/deemon/compiler/optimize/traits.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ ast_equal_impl(struct ast const *a,
goto eq;
if (Dee_TYPE(a->a_constexpr) != Dee_TYPE(b->a_constexpr))
goto ne;
temp = DeeObject_TryCompareForEquality(a->a_constexpr, b->a_constexpr);
temp = DeeObject_TryCompareEq(a->a_constexpr, b->a_constexpr);
if unlikely(temp == Dee_COMPARE_ERR)
DeeError_Handled(ERROR_HANDLED_RESTORE);
return temp == 0;
Expand Down
12 changes: 6 additions & 6 deletions src/deemon/execute/asm/exec.gas-386.S
Original file line number Diff line number Diff line change
Expand Up @@ -3872,12 +3872,12 @@ define_unary_inherited_op target_cast_varkwds, fSYM(DeeKw_WrapInherited,4)
define_unary_op target_str, fSYM(DeeObject_Str,4)
define_unary_op target_copy, fSYM(DeeObject_Copy,4)
define_unary_op target_deepcopy, fSYM(DeeObject_DeepCopy,4)
define_binary_op target_cmp_eq, fSYM(DeeObject_CompareEqObject,8)
define_binary_op target_cmp_ne, fSYM(DeeObject_CompareNeObject,8)
define_binary_op target_cmp_lo, fSYM(DeeObject_CompareLoObject,8)
define_binary_op target_cmp_le, fSYM(DeeObject_CompareLeObject,8)
define_binary_op target_cmp_gr, fSYM(DeeObject_CompareGrObject,8)
define_binary_op target_cmp_ge, fSYM(DeeObject_CompareGeObject,8)
define_binary_op target_cmp_eq, fSYM(DeeObject_CmpEq,8)
define_binary_op target_cmp_ne, fSYM(DeeObject_CmpNe,8)
define_binary_op target_cmp_lo, fSYM(DeeObject_CmpLo,8)
define_binary_op target_cmp_le, fSYM(DeeObject_CmpLe,8)
define_binary_op target_cmp_gr, fSYM(DeeObject_CmpGr,8)
define_binary_op target_cmp_ge, fSYM(DeeObject_CmpGe,8)


target_repr:
Expand Down
34 changes: 17 additions & 17 deletions src/deemon/execute/code-exec.c.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2357,23 +2357,23 @@ do_push_module:
DISPATCH();
}

#define DEFINE_COMPARE_INSTR(EQ, Eq) \
TARGET(ASM_CMP_##EQ, -2, +1) { \
DREF DeeObject *temp; \
temp = DeeObject_Compare##Eq##Object(SECOND, FIRST); \
if unlikely(!temp) \
HANDLE_EXCEPT(); \
POPREF(); \
Dee_Decref(TOP); \
TOP = temp; /* Inherit reference. */ \
DISPATCH(); \
}
DEFINE_COMPARE_INSTR(EQ, Eq)
DEFINE_COMPARE_INSTR(NE, Ne)
DEFINE_COMPARE_INSTR(LO, Lo)
DEFINE_COMPARE_INSTR(LE, Le)
DEFINE_COMPARE_INSTR(GR, Gr)
DEFINE_COMPARE_INSTR(GE, Ge)
#define DEFINE_COMPARE_INSTR(ASM_CMP_EQ, DeeObject_CmpEq) \
TARGET(ASM_CMP_EQ, -2, +1) { \
DREF DeeObject *temp; \
temp = DeeObject_CmpEq(SECOND, FIRST); \
if unlikely(!temp) \
HANDLE_EXCEPT(); \
POPREF(); \
Dee_Decref(TOP); \
TOP = temp; /* Inherit reference. */ \
DISPATCH(); \
}
DEFINE_COMPARE_INSTR(ASM_CMP_EQ, DeeObject_CmpEq)
DEFINE_COMPARE_INSTR(ASM_CMP_NE, DeeObject_CmpNe)
DEFINE_COMPARE_INSTR(ASM_CMP_LO, DeeObject_CmpLo)
DEFINE_COMPARE_INSTR(ASM_CMP_LE, DeeObject_CmpLe)
DEFINE_COMPARE_INSTR(ASM_CMP_GR, DeeObject_CmpGr)
DEFINE_COMPARE_INSTR(ASM_CMP_GE, DeeObject_CmpGe)
#undef DEFINE_COMPARE_INSTR

TARGET(ASM_CLASS_C, -1, +1) {
Expand Down
6 changes: 3 additions & 3 deletions src/deemon/execute/code.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ code_compare_eq_impl(DeeCodeObject *self, DeeCodeObject *other) {
int temp;
if (other->co_defaultv[i] == NULL)
goto nope;
temp = DeeObject_TryCompareForEquality(self->co_defaultv[i],
temp = DeeObject_TryCompareEq(self->co_defaultv[i],
other->co_defaultv[i]);
if (temp != 0)
return temp;
Expand All @@ -1658,7 +1658,7 @@ code_compare_eq_impl(DeeCodeObject *self, DeeCodeObject *other) {
if (self->co_constv) {
uint16_t i;
for (i = 0; i < self->co_constc; ++i) {
int temp = DeeObject_TryCompareForEquality(self->co_constv[i], other->co_constv[i]);
int temp = DeeObject_TryCompareEq(self->co_constv[i], other->co_constv[i]);
if (temp != 0)
return temp;
}
Expand All @@ -1682,7 +1682,7 @@ code_compare_eq_impl(DeeCodeObject *self, DeeCodeObject *other) {
}
if (bcmp(self->co_code, other->co_code, self->co_codebytes) != 0)
goto nope;
return DeeObject_TryCompareForEquality((DeeObject *)self->co_ddi,
return DeeObject_TryCompareEq((DeeObject *)self->co_ddi,
(DeeObject *)other->co_ddi);
nope:
return 1;
Expand Down
6 changes: 3 additions & 3 deletions src/deemon/execute/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,13 +1144,13 @@ function_compare_eq(Function *self, Function *other) {
int result;
if (DeeObject_AssertTypeExact(other, &DeeFunction_Type))
goto err;
result = DeeObject_CompareForEquality((DeeObject *)code,
result = DeeObject_CompareEq((DeeObject *)code,
(DeeObject *)other->fo_code);
if unlikely(result != 0)
goto done;
ASSERT(code->co_refc == other->fo_code->co_refc);
for (i = 0; i < code->co_refc; ++i) {
result = DeeObject_TryCompareForEquality(self->fo_refv[i],
result = DeeObject_TryCompareEq(self->fo_refv[i],
other->fo_refv[i]);
if (result != 0)
goto done;
Expand Down Expand Up @@ -1180,7 +1180,7 @@ function_compare_eq(Function *self, Function *other) {
Dee_Decref_unlikely(rhs);
goto not_equal;
} else {
result = DeeObject_TryCompareForEquality(self->fo_refv[i],
result = DeeObject_TryCompareEq(self->fo_refv[i],
other->fo_refv[i]);
Dee_Decref_unlikely(lhs);
Dee_Decref_unlikely(rhs);
Expand Down
Loading

0 comments on commit 03b1cc6

Please sign in to comment.