Skip to content

Commit

Permalink
Assign method metadata tokens before writing (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 authored Sep 29, 2024
1 parent d2cd4f7 commit db5837f
Showing 1 changed file with 2 additions and 1 deletion.
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 db5837f

Please sign in to comment.