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

Fixed some const constraint undef issues

This commit is contained in:
Brian Fiete 2021-12-31 13:51:08 -05:00
parent f35a3de175
commit 249f4f1016
4 changed files with 58 additions and 18 deletions

View file

@ -4074,7 +4074,10 @@ BfIRValue BfIRBuilder::CreateNumericCast(BfIRValue val, bool valIsSigned, BfType
FixTypeCode(typeCode);
if (val.IsConst())
{
auto constVal = GetConstantById(val.mId);
auto constVal = GetConstantById(val.mId);
if (constVal->mConstType == BfConstType_Undef)
return GetUndefConstValue(GetPrimitiveType(typeCode));
if (constVal->mTypeCode < BfTypeCode_Length)
{
// ? -> Int