diff --git a/Il2CppInterop.Generator/Utils/UnstripTranslator.cs b/Il2CppInterop.Generator/Utils/UnstripTranslator.cs index 6c20ced1..52bbfcae 100644 --- a/Il2CppInterop.Generator/Utils/UnstripTranslator.cs +++ b/Il2CppInterop.Generator/Utils/UnstripTranslator.cs @@ -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> labelMap = new(); Dictionary instructionMap = new();