mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Properly generates an error when allocating in a const expression
This commit is contained in:
parent
3e763b41df
commit
d1334b0c8f
1 changed files with 1 additions and 18 deletions
|
@ -8242,24 +8242,7 @@ BfIRValue BfModule::AllocFromType(BfType* type, const BfAllocTarget& allocTarget
|
|||
|
||||
if ((!hasCustomAllocator) && (mBfIRBuilder->mIgnoreWrites))
|
||||
{
|
||||
if (arraySize)
|
||||
{
|
||||
if (isRawArrayAlloc)
|
||||
{
|
||||
BfPointerType* ptrType = CreatePointerType(type);
|
||||
return GetDefaultValue(ptrType);
|
||||
}
|
||||
BfArrayType* arrayType = CreateArrayType(type, arrayDim);
|
||||
return GetDefaultValue(arrayType);
|
||||
}
|
||||
|
||||
if (type->IsValueType())
|
||||
{
|
||||
BfPointerType* ptrType = CreatePointerType(type);
|
||||
return GetDefaultValue(ptrType);
|
||||
}
|
||||
|
||||
return mBfIRBuilder->CreateAlloca(mBfIRBuilder->MapType(type));
|
||||
return mBfIRBuilder->GetFakeVal();
|
||||
}
|
||||
|
||||
AddDependency(type, mCurTypeInstance, BfDependencyMap::DependencyFlag_Allocates);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue