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:
parent
337a94b8b5
commit
d341104a57
5 changed files with 27 additions and 11 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue