IL2CPP: Add Unity 2021.1 TODOs

This commit is contained in:
Katy Coe
2020-11-26 21:42:16 +01:00
parent 479aeb7bcd
commit 7289001933
2 changed files with 2 additions and 0 deletions

View File

@@ -192,6 +192,7 @@ namespace Il2CppInspector
public uint attrs => (uint) bits & 0xffff; /* param attributes or field flags */ public uint attrs => (uint) bits & 0xffff; /* param attributes or field flags */
public Il2CppTypeEnum type => (Il2CppTypeEnum)((bits >> 16) & 0xff); public Il2CppTypeEnum type => (Il2CppTypeEnum)((bits >> 16) & 0xff);
// TODO: Unity 2021.1: num_mods becomes 1 bit shorter, shifting byref and pinned right 1 bit, valuetype bit added
public uint num_mods => (uint) (bits >> 24) & 0x3f; /* max 64 modifiers follow at the end */ public uint num_mods => (uint) (bits >> 24) & 0x3f; /* max 64 modifiers follow at the end */
public bool byref => ((bits >> 30) & 1) == 1; public bool byref => ((bits >> 30) & 1) == 1;
public bool pinned => (bits >> 31) == 1; /* valid when included in a local var signature */ public bool pinned => (bits >> 31) == 1; /* valid when included in a local var signature */

View File

@@ -63,6 +63,7 @@ namespace Il2CppInspector.Reflection
public string Name => $"RuntimeInvoker_{!IsStatic}{ReturnType.BaseName.ToCIdentifier()}_" + string.Join("_", ParameterTypes.Select(p => p.BaseName.ToCIdentifier())); public string Name => $"RuntimeInvoker_{!IsStatic}{ReturnType.BaseName.ToCIdentifier()}_" + string.Join("_", ParameterTypes.Select(p => p.BaseName.ToCIdentifier()));
// Display as a C++ method signature; MethodInfo* is the same as RuntimeMethod* (see codegen/il2cpp-codegen-metadata.h) // Display as a C++ method signature; MethodInfo* is the same as RuntimeMethod* (see codegen/il2cpp-codegen-metadata.h)
// TODO: Unity 2021.1: the return value is now an extra argument, and the invokers always return void
public string GetSignature(UnityVersion version) => public string GetSignature(UnityVersion version) =>
version.CompareTo("2017.1.0") >= 0 version.CompareTo("2017.1.0") >= 0
? $"void* {Name}(Il2CppMethodPointer pointer, const MethodInfo* methodMetadata, void* obj, void** args)" ? $"void* {Name}(Il2CppMethodPointer pointer, const MethodInfo* methodMetadata, void* obj, void** args)"