Going from dmd 2.081.2 to dmd 2.082.0 makes the code at the bottom crash. The reason is that TypeInfo_Pointer.getHash was changed in druntime, and that's used in the MultiIndexContainer for DStruct_Py_Mapping in the declaration
alias MultiIndexContainer!(Mapping, IndexedBy!(
HashedUnique!("a.d"), "d",
HashedUnique!("a.py"), "python"),
MallocAllocator, MutableView)
Container;
HashedUnique above is:
template HashedUnique(alias KeyFromValue="a",
alias Hash="typeid(a).getHash(&a)", alias Eq="a==b"){
alias Hashed!(false, KeyFromValue, Hash, Eq) HashedUnique;
}
It's the typeid(a).getHash(&a) that has changed implementation, and that caused pyd to crash with a failing assertion on multi_index.d:230 - the next pointer has an integer value.
It could be argued that this is a bug in druntime instead - but given how small the change was and that the new hash function could return 42 for every pointer and technically work I don't think so. Especially given the complexity of the implementation of MultiIndexContainer.
Going from dmd 2.081.2 to dmd 2.082.0 makes the code at the bottom crash. The reason is that
TypeInfo_Pointer.getHash
was changed in druntime, and that's used in theMultiIndexContainer
forDStruct_Py_Mapping
in the declarationHashedUnique
above is:It's the
typeid(a).getHash(&a)
that has changed implementation, and that caused pyd to crash with a failing assertion on multi_index.d:230 - thenext
pointer has an integer value.It could be argued that this is a bug in druntime instead - but given how small the change was and that the new hash function could return 42 for every pointer and technically work I don't think so. Especially given the complexity of the implementation of
MultiIndexContainer
.Code to reproduce: