mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixes for literal overflow detection
This commit is contained in:
parent
6a95cbb3b8
commit
a3b761ab26
6 changed files with 68 additions and 39 deletions
|
@ -3578,7 +3578,7 @@ void BfExprEvaluator::GetLiteral(BfAstNode* refNode, const BfVariant& variant)
|
|||
if ((mExpectingType != NULL) && (mExpectingType->IsIntegral()) && (mExpectingType->IsChar() == IsCharType(variant.mTypeCode)))
|
||||
{
|
||||
auto primType = (BfPrimitiveType*)mExpectingType;
|
||||
if (mModule->mSystem->DoesLiteralFit(primType->mTypeDef->mTypeCode, variant.mInt64))
|
||||
if (mModule->mSystem->DoesLiteralFit(primType->mTypeDef->mTypeCode, variant.mUInt64))
|
||||
{
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->CreateConst(primType->mTypeDef->mTypeCode, variant.mUInt64), mExpectingType);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue