Skip to content

Commit

Permalink
Expand Macros Before Unstripping (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 authored Sep 14, 2024
1 parent 89b8d31 commit 551ff84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Il2CppInterop.Generator/Utils/UnstripTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public static bool TranslateMethod(MethodDefinition original, MethodDefinition t
localVariableMap.Add(variableDefinition, newVariableDefinition);
}

// We expand macros because our instructions are not mapped one-to-one,
// so specialized instructions like Br_S need to be expanded to Br for safety.
// In pass 90, we optimize all macros, so we won't need to worry about that here.
original.CilMethodBody.Instructions.ExpandMacros();

List<KeyValuePair<CilInstructionLabel, CilInstructionLabel>> labelMap = new();
Dictionary<CilInstruction, CilInstruction> instructionMap = new();

Expand Down

0 comments on commit 551ff84

Please sign in to comment.