We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2911c5 commit 758b893Copy full SHA for 758b893
src/builtins.c
@@ -1164,6 +1164,12 @@ DLLEXPORT uptrint_t jl_object_id(jl_value_t *v)
1164
if (dt == jl_datatype_type) {
1165
jl_datatype_t *dtv = (jl_datatype_t*)v;
1166
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);
1173
return bitmix(bitmix(h, dtv->name->uid),
1174
jl_object_id((jl_value_t*)dtv->parameters));
1175
}
0 commit comments