Skip to content

Commit 91153df

Browse files
committed
fix a typekey_hash mistake with Type
The Type objects are not normalized by insertion into the cache, unlike all other types, so we need to be careful not to assign them a stable hash (which pre-supposes they will be hash-normalized).
1 parent 7fbee97 commit 91153df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/jltypes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ void jl_precompute_memoized_dt(jl_datatype_t *dt, int cacheable)
10421042
(((jl_datatype_t*)p)->name == jl_type_typename && !((jl_datatype_t*)p)->hasfreetypevars));
10431043
}
10441044
}
1045+
if (dt->name == jl_type_typename)
1046+
cacheable = 0; // the cache for Type ignores parameter normalization, so it can't be used as a regular hash
10451047
dt->hash = typekey_hash(dt->name, jl_svec_data(dt->parameters), l, cacheable);
10461048
}
10471049

0 commit comments

Comments
 (0)