Skip to content

Commit

Permalink
Requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Sep 22, 2024
1 parent 4105261 commit 86a90f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Il2CppInterop.Generator/Passes/Pass19CopyMethodParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void DoPass(RewriteGlobalContext context)
var newParameter = newMethod.AddParameter(
assemblyContext.RewriteTypeRef(originalMethodParameter.ParameterType),
newName,
originalMethodParameter.Definition!.Attributes & ~ParameterAttributes.HasFieldMarshal);
originalMethodParameter.GetOrCreateDefinition().Attributes & ~ParameterAttributes.HasFieldMarshal);

if (originalMethodParameter.IsParamsArray())
{
Expand All @@ -35,7 +35,7 @@ public static void DoPass(RewriteGlobalContext context)
}
else
{
newParameter.Definition!.Constant = originalMethodParameter.Definition.Constant;
newParameter.Definition!.Constant = originalMethodParameter.Definition!.Constant;
}
}

Expand Down
3 changes: 2 additions & 1 deletion Il2CppInterop.Generator/Passes/Pass90WriteToDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ public static void DoPass(RewriteGlobalContext context, GeneratorOptions options
asmContext.NewAssembly.CustomAttributes.Add(targetFrameworkAttribute);
}

// Optimize macros in all methods.
// Optimize macros in all methods and assign tokens.
foreach (var type in module.GetAllTypes())
{
foreach (var method in type.Methods)
{
method.CilMethodBody?.Instructions.OptimizeMacros();
module.TokenAllocator.AssignNextAvailableToken(method);
}
}
}
Expand Down

0 comments on commit 86a90f5

Please sign in to comment.