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

Fixed typedVal addr numeric cast

This commit is contained in:
Brian Fiete 2021-08-02 16:54:42 -07:00
parent 974b3a58e8
commit f0cca6dc40

View file

@ -12026,6 +12026,8 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
if (allowCast) if (allowCast)
{ {
if (typedVal.IsAddr())
typedVal = LoadValue(typedVal);
return mBfIRBuilder->CreateNumericCast(typedVal.mValue, typedVal.mType->IsSigned(), toTypeCode); return mBfIRBuilder->CreateNumericCast(typedVal.mValue, typedVal.mType->IsSigned(), toTypeCode);
} }
} }