Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Patched methods break exception propagation #24

Closed
notpeelz opened this issue Jan 29, 2021 · 1 comment
Closed

Patched methods break exception propagation #24

notpeelz opened this issue Jan 29, 2021 · 1 comment

Comments

@notpeelz
Copy link

notpeelz commented Jan 29, 2021

If a (patched) game method throws and exception, the trampoline code will complain about the exception (thus breaking the exception flow) and won't execute the postfix/prefix.

Example stack trace:

[Error  :    Detour] UnhollowerBaseLib.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object.

  at UnhollowerBaseLib.Il2CppException.RaiseExceptionIfNecessary (System.IntPtr returnedException) [0x00014] in <777559d3b76a4c3e8ec3d7f2e15ce0fa>:0
  at (wrapper dynamic-method) LevelGeneration.LG_MarkerFactory.DMD<LevelGeneration.LG_MarkerFactory::InstantiateMarkerGameObject>(LG_MarkerSpawner,GameData.ExpeditionFunction,single,single,single,bool&,bool)
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.(il2cpp -> managed) InstantiateMarkerGameObject(intptr,GameData.ExpeditionFunction,single,single,single,byte&,bool,UnhollowerBaseLib.Runtime.Il2CppMethodInfo*)
@knah
Copy link
Owner

knah commented Jun 13, 2021

In general, this would be an issue with the patching library, not Unhollower. However, support from unhollower would be nice to have, so I created a separate issue in #51 for rethrow support.

@knah knah closed this as completed Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants