ctable: hash COBJ_CFUNCTION based on cfunc and not the actual <obj>

This commit is contained in:
CPunch 2023-12-28 19:56:05 -06:00
parent e7b2d7d833
commit 0df56bd42a
1 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,8 @@ static uint32_t getObjectHash(CObj *obj)
switch (obj->type) {
case COBJ_STRING:
return ((CObjString *)obj)->hash;
case COBJ_CFUNCTION:
return (uint32_t)((CObjCFunction *)obj)->cfunc;
default:
return (uint32_t)obj; // just "hash" the pointer
}