From a1419279691cc8dca95a5d8c4ee91025e3ef01fb Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Sat, 28 Feb 2026 22:11:15 +0100 Subject: [PATCH] Add a scuffed workaround for issue #49 --- .../Cpp/CppDeclarationGenerator.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs b/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs index 59cb048..aa8d409 100644 --- a/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs +++ b/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs @@ -351,7 +351,17 @@ public class CppDeclarationGenerator foreach (var mi in GetFilledVTable(ti)) { - if (mi is { ContainsGenericParameters: false }) + // The VirtualAddress: not null constraint is a workaround for a much bigger issue: + // circular generic argument references that cause loops when inflating the types. + // ex. Class -> member Class -> instantiates Class -> member Class -> instantiates Class -> ... + // or Class -> member Class> -> instantiates Class> -> member Class>> -> ... + + // The only game (issue #49) that currently encounters this uses the MetaXR Unity SDK, + // which defines OVRTask which has a method that returns OVRTask. + // This filters out methods like that, as they get folded through generic sharing + // in the actual runtime. + + if (mi is { ContainsGenericParameters: false, VirtualAddress: not null }) IncludeMethod(mi); }