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

Cache ConstExpr ToString, fix const arg int comparison in cast

This commit is contained in:
Brian Fiete 2024-02-13 08:35:10 -05:00
parent 337a94b8b5
commit d341104a57
5 changed files with 27 additions and 11 deletions

View file

@ -12842,6 +12842,13 @@ BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue&
case BfTypeCode_Char32:
case BfTypeCode_StringId:
variant.mTypeCode = constant->mTypeCode;
if (((variant.mTypeCode == BfTypeCode_Int64) || (variant.mTypeCode == BfTypeCode_UInt64)) &&
(primType->mSize > 0) && (primType->mSize < 8) &&
(mBfIRBuilder->IsIntable(primType->GetTypeCode())))
{
// We may have an 'int unknown' that we need to downsize
variant.mTypeCode = primType->GetTypeCode();
}
variant.mInt64 = constant->mInt64;
break;
case BfTypeCode_Float: