--- erl_fun.c.orig 2008-01-17 00:03:10.000000000 +0100 +++ erl_fun.c 2008-01-17 00:23:23.000000000 +0100 @@ -97,6 +97,7 @@ long refc; ASSERT(is_atom(mod)); template.old_uniq = uniq; + sys_memset(template.uniq, 0, sizeof(template.uniq)); template.old_index = index; template.module = mod; erts_fun_write_lock(); @@ -120,6 +121,7 @@ ASSERT(is_atom(mod)); template.old_uniq = old_uniq; + sys_memcpy(template.uniq, uniq, sizeof(template.uniq)); template.old_index = old_index; template.module = mod; erts_fun_write_lock(); @@ -279,7 +281,10 @@ static HashValue fun_hash(ErlFunEntry* obj) { - return (HashValue) (obj->old_uniq ^ obj->old_index ^ atom_val(obj->module)); + return (HashValue) (obj->old_uniq ^ + *(int*)obj->uniq ^ + obj->old_index ^ + atom_val(obj->module)); } static int @@ -287,6 +292,7 @@ { return !(obj1->module == obj2->module && obj1->old_uniq == obj2->old_uniq && + sys_memcmp(obj1->uniq, obj2->uniq, sizeof(obj1->uniq)) == 0 && obj1->old_index == obj2->old_index); } @@ -297,6 +303,7 @@ sizeof(ErlFunEntry)); obj->old_uniq = template->old_uniq; + sys_memcpy(obj->uniq, template->uniq, sizeof(template->uniq)); obj->old_index = template->old_index; obj->module = template->module; erts_refc_init(&obj->refc, -1);