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

Reflection fixes on Win32

This commit is contained in:
Brian Fiete 2020-07-06 17:58:46 -07:00
parent 6e6487d951
commit 4ac56a2432
6 changed files with 102 additions and 83 deletions

View file

@ -1158,8 +1158,23 @@ void BeIRCodeGen::HandleNextCmd()
{
CMD_PARAM(BeValue*, val);
CMD_PARAM(bool, valIsSigned);
BfTypeCode typeCode = (BfTypeCode)mStream->Read();
BfTypeCode valTypeCode = GetTypeCode(val->GetType(), valIsSigned);
BfTypeCode valTypeCode = GetTypeCode(val->GetType(), valIsSigned);
if (auto srcCastConstant = BeValueDynCast<BeCastConstant>(val))
{
BeType* toType = GetBeType(typeCode, valIsSigned);
auto castedVal = mBeModule->mAlloc.Alloc<BeCastConstant>();
castedVal->mInt64 = srcCastConstant->mInt64;
castedVal->mType = toType;
castedVal->mTarget = srcCastConstant->mTarget;
SetResult(curId, castedVal);
break;
}
bool toSigned = false;
auto toBeType = GetBeType(typeCode, toSigned);
BeValue* retVal = mBeModule->CreateNumericCast(val, toBeType, valIsSigned, toSigned);