Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StackFrame.AddFrames patch fails if other mod patches it #74

Merged
merged 1 commit into from
May 28, 2024

Conversation

DiFFoZ
Copy link
Contributor

@DiFFoZ DiFFoZ commented Apr 7, 2024

Fixes this exception if other mods (like BepInEx_MonoMod_Debug_Patcher) patches the StackFrame.AddFrames.

KeyNotFoundException: The given key was not present in the dictionary.
  at MonoMod.Cil.ILCursor.GotoNext (MonoMod.Cil.MoveType moveType, System.Func`2[Mono.Cecil.Cil.Instruction,System.Boolean][] predicates) [0x0000a] in <6733e342b5b549bba815373898724469>:0 
  at MonoMod.Cil.ILCursor.GotoNext (System.Func`2[Mono.Cecil.Cil.Instruction,System.Boolean][] predicates) [0x00000] in <6733e342b5b549bba815373898724469>:0 
  at LethalLib.Plugin.IlHook (MonoMod.Cil.ILContext il) [0x00007] in <c68aa40cbbae4bd69cd2fcd50c8f1ae1>:0 
  at MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext+Manipulator manip) [0x00087] in <6733e342b5b549bba815373898724469>:0 
  at MonoMod.RuntimeDetour.ILHook+Context.InvokeManipulator (Mono.Cecil.MethodDefinition def, MonoMod.Cil.ILContext+Manipulator cb) [0x00012] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at (wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context)
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?373559048(object)
  at HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) [0x00000] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00059] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase from, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.RuntimeDetour.ILHookConfig& config) [0x00148] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase from, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.RuntimeDetour.ILHookConfig config) [0x00000] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase from, MonoMod.Cil.ILContext+Manipulator manipulator) [0x0001c] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at LethalLib.Plugin.Awake () [0x00086] in <c68aa40cbbae4bd69cd2fcd50c8f1ae1>:0 

@Hamunii
Copy link
Collaborator

Hamunii commented May 28, 2024

lgtm

@Hamunii Hamunii merged commit 8a5695a into EvaisaDev:main May 28, 2024
@DiFFoZ DiFFoZ deleted the fix/stackframe-patch branch May 28, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants