From 0d0aef0970e81de9a830e2a06fa71ee30c3faf91 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Mon, 3 Jun 2019 05:50:53 -0500 Subject: [PATCH] Added tailcall prefix to patches in stdout interceptor patches --- IPA.Loader/Logging/StdoutInterceptor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IPA.Loader/Logging/StdoutInterceptor.cs b/IPA.Loader/Logging/StdoutInterceptor.cs index e7edf942..e1d5fa29 100644 --- a/IPA.Loader/Logging/StdoutInterceptor.cs +++ b/IPA.Loader/Logging/StdoutInterceptor.cs @@ -137,6 +137,7 @@ namespace IPA.Logging { var getColorM = typeof(ConsoleHarmonyPatches).GetMethod("GetColor"); return new[] { + new CodeInstruction(OpCodes.Tailcall), new CodeInstruction(OpCodes.Call, getColorM), new CodeInstruction(OpCodes.Ret) }; @@ -147,6 +148,7 @@ namespace IPA.Logging var setColorM = typeof(ConsoleHarmonyPatches).GetMethod("SetColor"); return new[] { new CodeInstruction(OpCodes.Ldarg_0), + new CodeInstruction(OpCodes.Tailcall), new CodeInstruction(OpCodes.Call, setColorM), new CodeInstruction(OpCodes.Ret) }; @@ -156,6 +158,7 @@ namespace IPA.Logging { var resetColor = typeof(ConsoleHarmonyPatches).GetMethod("ResetColor"); return new[] { + new CodeInstruction(OpCodes.Tailcall), new CodeInstruction(OpCodes.Call, resetColor), new CodeInstruction(OpCodes.Ret) };