This PR fixes a crash after call to GenericMethod::GetMethod() hook.
This issue appears on Unity version 2020.3.41+, and in some cases in 2021.3.12+, 2022.1.23+ because of this fix
In these versions Object::GetVirtualMethod() calls GenericMethod::GetGenericVirtualMethod() instead of GenericMethod::GetMethod()
This also has an annoying interaction with shims added in 2021.2.0, where they get inlined together.
I also removed targetTargets.Length == 1 check because it seems to be always true, due to early return in GenericMethod::GetMethod() that I noticed. Unfortunately because of this, problems on debug builds could emerge. I don't know if these are important though.
Tested on a custom test game built using 2020.3.46.
@decaprime also confirmed no issues on their beta version of the V Rising Unity 2020.3.46
Also tested on CoreKeeper 2021.3.14, no issues there.
For reference some relevant Unity libil2cpp versions are available here: link
This PR fixes a crash after call to
GenericMethod::GetMethod()
hook. This issue appears on Unity version 2020.3.41+, and in some cases in 2021.3.12+, 2022.1.23+ because of this fixIn these versions
Object::GetVirtualMethod()
callsGenericMethod::GetGenericVirtualMethod()
instead ofGenericMethod::GetMethod()
This also has an annoying interaction with shims added in 2021.2.0, where they get inlined together.I also removed
targetTargets.Length == 1
check because it seems to be always true, due to early return inGenericMethod::GetMethod()
that I noticed. Unfortunately because of this, problems on debug builds could emerge. I don't know if these are important though.Tested on a custom test game built using 2020.3.46. @decaprime also confirmed no issues on their beta version of the V Rising Unity 2020.3.46 Also tested on CoreKeeper 2021.3.14, no issues there.
For reference some relevant Unity libil2cpp versions are available here: link