1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fix for valueless array allocations

This commit is contained in:
Brian Fiete 2020-02-17 14:49:59 -08:00
parent fe531be4ef
commit 6dd49f5d9b
4 changed files with 21 additions and 12 deletions

View file

@ -11279,8 +11279,11 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
}
mModule->mBfIRBuilder->PopulateType(resultType);
mModule->mBfIRBuilder->CreateMemSet(mModule->CreateIndexedValue(resultType, addr, clearFromIdx),
mModule->mBfIRBuilder->CreateConst(BfTypeCode_Int8, isUninit ? 0xCC : 0), clearBytes, resultType->mAlign);
if (!resultType->IsValuelessType())
{
mModule->mBfIRBuilder->CreateMemSet(mModule->CreateIndexedValue(resultType, addr, clearFromIdx),
mModule->mBfIRBuilder->CreateConst(BfTypeCode_Int8, isUninit ? 0xCC : 0), clearBytes, resultType->mAlign);
}
}
};