diff --git a/BeefLibs/corlib/src/Type.bf b/BeefLibs/corlib/src/Type.bf index 89bcb9c4..9c76b702 100644 --- a/BeefLibs/corlib/src/Type.bf +++ b/BeefLibs/corlib/src/Type.bf @@ -693,8 +693,8 @@ namespace System.Reflection public struct FieldData { public String mName; - public int mData; - public TypeId mFieldTypeId; + public TypeId mFieldTypeId; + public int64 mData; public FieldFlags mFlags; public int32 mCustomAttributesIdx; } diff --git a/IDE/mintest/minlib/src/System/Type.bf b/IDE/mintest/minlib/src/System/Type.bf index 0e7be62b..9a7a0601 100644 --- a/IDE/mintest/minlib/src/System/Type.bf +++ b/IDE/mintest/minlib/src/System/Type.bf @@ -654,8 +654,8 @@ namespace System.Reflection public struct FieldData { public String mName; - public int mData; - public TypeId mFieldTypeId; + public TypeId mFieldTypeId; + public int64 mData; public FieldFlags mFlags; public int32 mCustomAttributesIdx; } diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index c5c9d25e..b833666c 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -6382,8 +6382,8 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin { emptyValueType, payloadNameConst, // mName - GetConstValue(0, intPtrType), // mData - GetConstValue(payloadType->mTypeId, typeIdType), // mFieldTypeId + GetConstValue(payloadType->mTypeId, typeIdType), // mFieldTypeId + GetConstValue(0, longType), // mData GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumPayload, shortType), // mFlags GetConstValue(-1, intType), // mCustomAttributesIdx }; @@ -6396,9 +6396,9 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin SizedArray dscrFieldVals = { emptyValueType, - dscrNameConst, // mName - GetConstValue(BF_ALIGN(payloadType->mSize, dscrType->mAlign), intPtrType), // mData - GetConstValue(dscrType->mTypeId, typeIdType), // mFieldTypeId + dscrNameConst, // mName + GetConstValue(dscrType->mTypeId, typeIdType), // mFieldTypeId + GetConstValue(BF_ALIGN(payloadType->mSize, dscrType->mAlign), longType), // mData GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumDiscriminator, shortType), // mFlags GetConstValue(-1, intType), // mCustomAttributesIdx }; @@ -6445,7 +6445,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin if (fieldInstance->mConstIdx != -1) { auto constant = typeInstance->mConstHolder->GetConstantById(fieldInstance->mConstIdx); - constValue = mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, constant->mUInt64); + constValue = mBfIRBuilder->CreateConst(BfTypeCode_Int64, constant->mUInt64); } } else if (fieldInstance->GetFieldDef()->mIsStatic) @@ -6466,20 +6466,19 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin if (refVal.IsAddr()) { - constValue = mBfIRBuilder->CreatePtrToInt(refVal.mValue, BfTypeCode_IntPtr); + constValue = mBfIRBuilder->CreatePtrToInt(refVal.mValue, BfTypeCode_Int64); } } if (!constValue) - constValue = mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, fieldInstance->mDataOffset); - + constValue = mBfIRBuilder->CreateConst(BfTypeCode_Int64, fieldInstance->mDataOffset); SizedArray fieldVals = { emptyValueType, - fieldNameConst, // mName - constValue, // mConstValue + fieldNameConst, // mName GetConstValue(typeId, typeIdType), // mFieldTypeId + constValue, // mConstValue GetConstValue(fieldFlags, shortType), // mFlags GetConstValue(customAttrIdx, intType), // mCustomAttributesIdx };