Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cpp2IL.Core/Model/Contexts/ApplicationAnalysisContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using AssetRipper.Primitives;
Expand Down Expand Up @@ -198,6 +199,14 @@ private void PopulateMethodsByAddressTable()
return ResolveContextForType(methodDefinition?.DeclaringType)?.Methods.FirstOrDefault(m => m.Definition == methodDefinition);
}

[return: NotNullIfNotNull(nameof(methodReference))]
public ConcreteGenericMethodAnalysisContext? ResolveContextForMethod(Cpp2IlMethodRef? methodReference)
{
return methodReference is not null
? ConcreteGenericMethodsByRef.TryGetValue(methodReference, out var context) ? context : new(methodReference, this)
: null;
}

public FieldAnalysisContext? ResolveContextForField(Il2CppFieldDefinition? field)
{
return ResolveContextForType(field?.DeclaringType)?.Fields.FirstOrDefault(f => f.BackingData?.Field == field);
Expand Down
Loading