Fix two instances of OBJECT_VAL called on non-object

This commit is contained in:
K. Lange 2024-03-02 12:37:14 +09:00
parent 158f660695
commit ea55152aac
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ KRK_Method(set,__contains__) {
KRK_Method(set,__repr__) {
METHOD_TAKES_NONE();
if (((KrkObj*)self)->flags & KRK_OBJ_FLAGS_IN_REPR) return OBJECT_VAL("{...}");
if (((KrkObj*)self)->flags & KRK_OBJ_FLAGS_IN_REPR) return OBJECT_VAL(S("{...}"));
if (!self->entries.capacity) return OBJECT_VAL(S("set()"));
((KrkObj*)self)->flags |= KRK_OBJ_FLAGS_IN_REPR;
struct StringBuilder sb = {0};

View File

@ -118,7 +118,7 @@ KRK_Method(slice,__init__) {
KRK_Method(slice,__repr__) {
METHOD_TAKES_NONE();
if (((KrkObj*)self)->flags & KRK_OBJ_FLAGS_IN_REPR) return OBJECT_VAL("slice(...)");
if (((KrkObj*)self)->flags & KRK_OBJ_FLAGS_IN_REPR) return OBJECT_VAL(S("slice(...)"));
((KrkObj*)self)->flags |= KRK_OBJ_FLAGS_IN_REPR;
struct StringBuilder sb = {0};
pushStringBuilderStr(&sb,"slice(",6);