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

Removed invalid undef return

This commit is contained in:
Brian Fiete 2021-10-22 11:47:47 -07:00
parent 7cd16974b1
commit bfb5435ce3

View file

@ -5473,6 +5473,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
auto constRet = mModule->mCompiler->mCEMachine->Call(targetSrc, mModule, methodInstance, irArgs, evalFlags, mExpectingType);
if (constRet)
{
auto constant = mModule->mBfIRBuilder->GetConstant(constRet.mValue);
BF_ASSERT(!constRet.mType->IsVar());
return constRet;
}
@ -5518,8 +5519,8 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
return mModule->GetDefaultTypedValue(mExpectingType, true, BfDefaultValueKind_Undef);
}
}
return mModule->GetDefaultTypedValue(returnType, true, BfDefaultValueKind_Undef);
return mModule->GetDefaultTypedValue(returnType, true, BfDefaultValueKind_Addr);
}
return _GetDefaultReturnValue();