Skip to content

Commit

Permalink
try to fix the intermittent failures since JuliaLang#10380
Browse files Browse the repository at this point in the history
I believe the bug was due to the need to hash typename->primary
specially, based on how other type functions treat it.
  • Loading branch information
JeffBezanson authored and mbauman committed Jun 5, 2015
1 parent f2911c5 commit 758b893
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,12 @@ DLLEXPORT uptrint_t jl_object_id(jl_value_t *v)
if (dt == jl_datatype_type) {
jl_datatype_t *dtv = (jl_datatype_t*)v;
uptrint_t h = 0xda1ada1a;
// has_typevars always returns 0 on name->primary, so that type
// can exist in the cache. however, interpreter.c mutates its
// typevars' `bound` fields to 0, corrupting the cache. this is
// avoided simply by hashing name->primary specially here.
if (dtv->name->primary == v)
return bitmix(bitmix(h, dtv->name->uid), 0xaa5566aa);
return bitmix(bitmix(h, dtv->name->uid),
jl_object_id((jl_value_t*)dtv->parameters));
}
Expand Down

0 comments on commit 758b893

Please sign in to comment.