Add generics support to TypeInfo.GetVTable

This patch fixes TypeInfo.GetVTable so that it specializes the vtable
for generic type instances. Also fix a minor bug in PropertyInfo that
would pass null pointers to GetMethodByDefinition.
This commit is contained in:
Robert Xiao
2020-04-20 00:11:31 -07:00
committed by Katy
parent 359b99fded
commit 4ba48b9c75
3 changed files with 29 additions and 12 deletions

View File

@@ -77,8 +77,10 @@ namespace Il2CppInspector.Reflection {
rootDefinition = propertyDef;
Name = propertyDef.Name;
GetMethod = declaringType.GetMethodByDefinition(propertyDef.GetMethod);
SetMethod = declaringType.GetMethodByDefinition(propertyDef.SetMethod);
if (propertyDef.GetMethod != null)
GetMethod = declaringType.GetMethodByDefinition(propertyDef.GetMethod);
if (propertyDef.SetMethod != null)
SetMethod = declaringType.GetMethodByDefinition(propertyDef.SetMethod);
}
}
}