Browse Source

Added tailcall prefix to patches in stdout interceptor patches

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
0d0aef0970
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      IPA.Loader/Logging/StdoutInterceptor.cs

+ 3
- 0
IPA.Loader/Logging/StdoutInterceptor.cs View File

@ -137,6 +137,7 @@ namespace IPA.Logging
{ {
var getColorM = typeof(ConsoleHarmonyPatches).GetMethod("GetColor"); var getColorM = typeof(ConsoleHarmonyPatches).GetMethod("GetColor");
return new[] { return new[] {
new CodeInstruction(OpCodes.Tailcall),
new CodeInstruction(OpCodes.Call, getColorM), new CodeInstruction(OpCodes.Call, getColorM),
new CodeInstruction(OpCodes.Ret) new CodeInstruction(OpCodes.Ret)
}; };
@ -147,6 +148,7 @@ namespace IPA.Logging
var setColorM = typeof(ConsoleHarmonyPatches).GetMethod("SetColor"); var setColorM = typeof(ConsoleHarmonyPatches).GetMethod("SetColor");
return new[] { return new[] {
new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Tailcall),
new CodeInstruction(OpCodes.Call, setColorM), new CodeInstruction(OpCodes.Call, setColorM),
new CodeInstruction(OpCodes.Ret) new CodeInstruction(OpCodes.Ret)
}; };
@ -156,6 +158,7 @@ namespace IPA.Logging
{ {
var resetColor = typeof(ConsoleHarmonyPatches).GetMethod("ResetColor"); var resetColor = typeof(ConsoleHarmonyPatches).GetMethod("ResetColor");
return new[] { return new[] {
new CodeInstruction(OpCodes.Tailcall),
new CodeInstruction(OpCodes.Call, resetColor), new CodeInstruction(OpCodes.Call, resetColor),
new CodeInstruction(OpCodes.Ret) new CodeInstruction(OpCodes.Ret)
}; };


Loading…
Cancel
Save