mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Soften splat error in BfModule::Cast
This commit is contained in:
parent
a5a7e6efe0
commit
0c6bf2d6b5
3 changed files with 37 additions and 5 deletions
|
@ -14857,6 +14857,12 @@ BfTypedValue BfModule::Cast(BfAstNode* srcNode, const BfTypedValue& typedVal, Bf
|
|||
{
|
||||
if (typedVal.IsSplat())
|
||||
{
|
||||
if ((!toStructTypeInstance->IsSplattable()) && (toStructTypeInstance->mInstSize != 0))
|
||||
{
|
||||
InternalError("typedVal.IsSplat(), but !toStructTypeInstance->IsSplattable() && toStructTypeInstance->mInstSize != 0", srcNode);
|
||||
return GetDefaultTypedValue(toType, true, BfDefaultValueKind_Addr);
|
||||
}
|
||||
|
||||
BF_ASSERT(toStructTypeInstance->IsSplattable() || (toStructTypeInstance->mInstSize == 0));
|
||||
return BfTypedValue(typedVal.mValue, toStructTypeInstance, typedVal.IsThis() ? BfTypedValueKind_ThisSplatHead : BfTypedValueKind_SplatHead);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue