Skip to content

Commit

Permalink
ctable: hash COBJ_CFUNCTION based on cfunc and not the actual <obj>
Browse files Browse the repository at this point in the history
  • Loading branch information
CPunch committed Dec 29, 2023
1 parent e7b2d7d commit 0df56bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ctable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0df56bd

Please sign in to comment.