1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-30 05:15:59 +02:00

Reflection field value fixes and tests

This commit is contained in:
Brian Fiete 2020-08-24 10:19:17 -07:00
parent d4c78c0799
commit d864a912c5
3 changed files with 41 additions and 1 deletions

View file

@ -150,7 +150,7 @@ namespace System.Reflection
return &value;*/
if (type.IsBoxed)
return ((uint8*)(void*)value) + type.[Friend]mMemberDataOffset;
return ((uint8*)Internal.UnsafeCastToPtr(value)) + type.[Friend]mMemberDataOffset;
return ((uint8*)Internal.UnsafeCastToPtr(value));
}

View file

@ -733,6 +733,12 @@ namespace System.Reflection
public override bool IsSubtypeOf(Type checkBaseType)
{
TypeInstance curType = this;
if (curType.IsBoxed)
{
curType = curType.UnderlyingType as TypeInstance;
if (curType == null)
return false;
}
while (true)
{
if (curType == checkBaseType)