1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed expandedParamsArray in unspecialized sections

This commit is contained in:
Brian Fiete 2024-02-13 06:42:06 -05:00
parent b80db38cdc
commit 36700b39ab
2 changed files with 6 additions and 2 deletions

View file

@ -8438,7 +8438,12 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
{
if (argValue)
{
if (IsConstEval())
if (argValue.mValue.IsFake())
{
if ((!mModule->IsInUnspecializedGeneric()) && (!mModule->mBfIRBuilder->mIgnoreWrites))
mModule->InternalError("Invalid expandedParamsArray value");
}
else if (IsConstEval())
{
auto constant = mModule->mBfIRBuilder->GetConstant(expandedParamsArray.mValue);
BF_ASSERT(constant->mConstType == BfConstType_Agg);

View file

@ -13280,7 +13280,6 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
}
else
fromTypedValue = BfTypedValue(mBfIRBuilder->GetFakeVal(), genericParamInst->mTypeConstraint, genericParamInst->mTypeConstraint->IsValueType());
prevIgnoreWrites.Restore();
auto result = CastToValue(srcNode, fromTypedValue, toType, (BfCastFlags)(castFlags | BfCastFlags_SilentFail));
if (result)