1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

CreateMemSet const protection

This commit is contained in:
Brian Fiete 2024-05-21 09:53:19 -04:00
parent 48a988ff70
commit 715e2dcaf9

View file

@ -15952,7 +15952,7 @@ void BfExprEvaluator::CreateObject(BfObjectCreateExpression* objCreateExpr, BfAs
}
mModule->mBfIRBuilder->PopulateType(resultType);
if (!resultType->IsValuelessType())
if ((!resultType->IsValuelessType()) && (!addr.IsConst()))
{
mModule->mBfIRBuilder->CreateMemSet(mModule->CreateIndexedValue(resultType, addr, clearFromIdx),
mModule->mBfIRBuilder->CreateConst(BfTypeCode_Int8, isUninit ? 0xCC : 0), clearBytes, resultType->mAlign);