1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed const expression hashing

This commit is contained in:
Brian Fiete 2020-08-10 06:39:07 -07:00
parent a6e191d2f1
commit 6b67a4493d

View file

@ -2648,10 +2648,7 @@ int BfResolvedTypeSet::Hash(BfType* type, LookupContext* ctx, bool allowRef)
else if (type->IsConstExprValue())
{
BfConstExprValueType* constExprValueType = (BfConstExprValueType*)type;
int hashVal = (constExprValueType->mValue.mInt32 << 17) ^ HASH_CONSTTYPE;
int elemHash = Hash(constExprValueType->mType, ctx);
hashVal = ((hashVal ^ elemHash) << 5) - hashVal;
return hashVal;
return ((int)constExprValueType->mValue.mTypeCode << 17) ^ (constExprValueType->mValue.mInt32 << 3) ^ HASH_CONSTTYPE;
}
else
{