IL2CPP: Fix crash when loading Il2CppCodeGenModule with no concrete methods (#58)

This commit is contained in:
Katy Coe
2020-08-22 03:30:17 +02:00
parent 5828ed106b
commit 54ac9d7c1a
2 changed files with 9 additions and 2 deletions

View File

@@ -146,6 +146,7 @@ namespace Il2CppInspector.Reflection
.ToDictionary(g => g.Key, g => g.GroupBy(a => a.AttributeType).Select(g => g.First()).ToList());
// Create method invokers (one per signature, in invoker index order)
// Generic type definitions have an invoker index of -1
foreach (var method in MethodsByDefinitionIndex) {
var index = package.GetInvokerIndex(method.DeclaringType.Assembly.ModuleDefinition, method.Definition);
if (index != -1) {
@@ -156,7 +157,6 @@ namespace Il2CppInspector.Reflection
}
}
// TODO: Some invokers are not initialized or missing, need to find out why
// Create method invokers sourced from generic method invoker indices
foreach (var spec in GenericMethods.Keys) {
if (package.GenericMethodInvokerIndices.TryGetValue(spec, out var index)) {