Skip to content

Commit 758b893

Browse files
JeffBezansonmbauman
authored andcommitted
try to fix the intermittent failures since JuliaLang#10380
I believe the bug was due to the need to hash typename->primary specially, based on how other type functions treat it.
1 parent f2911c5 commit 758b893

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/builtins.c

+6
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,12 @@ DLLEXPORT uptrint_t jl_object_id(jl_value_t *v)
11641164
if (dt == jl_datatype_type) {
11651165
jl_datatype_t *dtv = (jl_datatype_t*)v;
11661166
uptrint_t h = 0xda1ada1a;
1167+
// has_typevars always returns 0 on name->primary, so that type
1168+
// can exist in the cache. however, interpreter.c mutates its
1169+
// typevars' `bound` fields to 0, corrupting the cache. this is
1170+
// avoided simply by hashing name->primary specially here.
1171+
if (dtv->name->primary == v)
1172+
return bitmix(bitmix(h, dtv->name->uid), 0xaa5566aa);
11671173
return bitmix(bitmix(h, dtv->name->uid),
11681174
jl_object_id((jl_value_t*)dtv->parameters));
11691175
}

0 commit comments

Comments
 (0)