Output: Annotate unmanaged type usages with 'unsafe' keyword

This commit is contained in:
Katy Coe
2019-11-10 18:53:07 +01:00
parent 54d03b9f0f
commit 5bf6e2c7c3
5 changed files with 13 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ namespace Il2CppInspector.Reflection
private readonly int returnTypeUsage;
public TypeInfo ReturnType => Assembly.Model.GetTypeFromUsage(returnTypeUsage, MemberTypes.TypeInfo);
public override bool RequiresUnsafeContext => base.RequiresUnsafeContext || ReturnType.RequiresUnsafeContext;
// IL2CPP doesn't seem to retain return type custom attributes
public MethodInfo(Il2CppInspector pkg, int methodIndex, TypeInfo declaringType) : base(pkg, methodIndex, declaringType) {