mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Properly handle splattable cast to base where base is CRepr
This commit is contained in:
parent
e46f525e90
commit
c18c76b4fe
1 changed files with 1 additions and 4 deletions
|
@ -14839,10 +14839,7 @@ BfTypedValue BfModule::Cast(BfAstNode* srcNode, const BfTypedValue& typedVal, Bf
|
||||||
if (typedVal.IsSplat())
|
if (typedVal.IsSplat())
|
||||||
{
|
{
|
||||||
if ((!toStructTypeInstance->IsSplattable()) && (toStructTypeInstance->mInstSize != 0))
|
if ((!toStructTypeInstance->IsSplattable()) && (toStructTypeInstance->mInstSize != 0))
|
||||||
{
|
return Cast(srcNode, MakeAddressable(typedVal), toType, castFlags);
|
||||||
InternalError("typedVal.IsSplat(), but !toStructTypeInstance->IsSplattable() && toStructTypeInstance->mInstSize != 0", srcNode);
|
|
||||||
return GetDefaultTypedValue(toType, true, BfDefaultValueKind_Addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
BF_ASSERT(toStructTypeInstance->IsSplattable() || (toStructTypeInstance->mInstSize == 0));
|
BF_ASSERT(toStructTypeInstance->IsSplattable() || (toStructTypeInstance->mInstSize == 0));
|
||||||
return BfTypedValue(typedVal.mValue, toStructTypeInstance, typedVal.IsThis() ? BfTypedValueKind_ThisSplatHead : BfTypedValueKind_SplatHead);
|
return BfTypedValue(typedVal.mValue, toStructTypeInstance, typedVal.IsThis() ? BfTypedValueKind_ThisSplatHead : BfTypedValueKind_SplatHead);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue