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:
parent
080dd5a25e
commit
a14544efa6
1 changed files with 5 additions and 1 deletions
|
@ -3171,10 +3171,14 @@ int BfResolvedTypeSet::Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHash
|
||||||
hashVal = ((hashVal ^ elemHash) << 5) - hashVal;
|
hashVal = ((hashVal ^ elemHash) << 5) - hashVal;
|
||||||
return hashVal;
|
return hashVal;
|
||||||
}
|
}
|
||||||
if (!typedVal)
|
if (!typedVal)
|
||||||
ctx->mFailed = true;
|
ctx->mFailed = true;
|
||||||
if (typedVal)
|
if (typedVal)
|
||||||
|
{
|
||||||
|
SetAndRestoreValue<bool> prevIgnoreWrites(ctx->mModule->mBfIRBuilder->mIgnoreWrites, true);
|
||||||
typedVal = ctx->mModule->Cast(sizeExpr, typedVal, intType);
|
typedVal = ctx->mModule->Cast(sizeExpr, typedVal, intType);
|
||||||
|
}
|
||||||
|
|
||||||
if (typedVal)
|
if (typedVal)
|
||||||
{
|
{
|
||||||
auto constant = ctx->mModule->mBfIRBuilder->GetConstant(typedVal.mValue);
|
auto constant = ctx->mModule->mBfIRBuilder->GetConstant(typedVal.mValue);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue