mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
CreateConstExprValueType fix with incoming constExprType TypedValue
This commit is contained in:
parent
fd24ab21af
commit
ac7f66c1f1
2 changed files with 10 additions and 1 deletions
|
@ -13266,8 +13266,14 @@ BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue&
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (value.mType->IsConstExprValue())
|
||||
{
|
||||
auto constExprType = (BfConstExprValueType*)value.mType;
|
||||
return constExprType->mValue;
|
||||
}
|
||||
else if (value.mType->IsValueType())
|
||||
{
|
||||
PopulateType(value.mType);
|
||||
int allocSize = value.mType->mSize + 4;
|
||||
BfVariant::StructData* structData = (BfVariant::StructData*)(new uint8[allocSize]);
|
||||
memset(structData, 0, allocSize);
|
||||
|
|
|
@ -7742,6 +7742,9 @@ BfPointerType* BfModule::CreatePointerType(BfType* resolvedType)
|
|||
|
||||
BfConstExprValueType* BfModule::CreateConstExprValueType(const BfTypedValue& typedValue, bool allowCreate)
|
||||
{
|
||||
if (typedValue.mType->IsConstExprValue())
|
||||
return (BfConstExprValueType*)typedValue.mType;
|
||||
|
||||
BfPopulateType populateType = allowCreate ? BfPopulateType_Data : BfPopulateType_Identity;
|
||||
BfResolveTypeRefFlags resolveFlags = allowCreate ? BfResolveTypeRefFlag_None : BfResolveTypeRefFlag_NoCreate;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue