IL2CPP: Fix regression in Metadata.Sizeof relating to #148
This commit is contained in:
@@ -221,14 +221,10 @@ namespace Il2CppInspector
|
|||||||
int size = 0;
|
int size = 0;
|
||||||
foreach (var i in type.GetTypeInfo().GetFields())
|
foreach (var i in type.GetTypeInfo().GetFields())
|
||||||
{
|
{
|
||||||
// Only process fields for our selected object versioning
|
// Only process fields for our selected object versioning (always process if none supplied)
|
||||||
var versionAttr = i.GetCustomAttribute<VersionAttribute>(false);
|
var versions = i.GetCustomAttributes<VersionAttribute>(false).Select(v => (v.Min, v.Max)).ToList();
|
||||||
if (versionAttr != null) {
|
if (versions.Any() && !versions.Any(v => (v.Min <= metadataVersion || v.Min == -1) && (v.Max >= metadataVersion || v.Max == -1)))
|
||||||
if (versionAttr.Min != -1 && versionAttr.Min > metadataVersion)
|
continue;
|
||||||
continue;
|
|
||||||
if (versionAttr.Max != -1 && versionAttr.Max < metadataVersion)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i.FieldType == typeof(long) || i.FieldType == typeof(ulong))
|
if (i.FieldType == typeof(long) || i.FieldType == typeof(ulong))
|
||||||
size += longSizeBytes;
|
size += longSizeBytes;
|
||||||
|
|||||||
Reference in New Issue
Block a user