1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Fixed potential non-const cast of array size in type lookup

This commit is contained in:
Brian Fiete 2021-01-05 16:23:49 -08:00
parent 080dd5a25e
commit a14544efa6

View file

@ -3174,7 +3174,11 @@ int BfResolvedTypeSet::Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHash
if (!typedVal)
ctx->mFailed = true;
if (typedVal)
{
SetAndRestoreValue<bool> prevIgnoreWrites(ctx->mModule->mBfIRBuilder->mIgnoreWrites, true);
typedVal = ctx->mModule->Cast(sizeExpr, typedVal, intType);
}
if (typedVal)
{
auto constant = ctx->mModule->mBfIRBuilder->GetConstant(typedVal.mValue);