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

2023.3/platform/windows/uum-62035 to unity-2023.3-mbe #2005

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

TautvydasZilys
Copy link

Backport of #2003

Fix marshaling/interop code emitting ldloc 65535 instruction when calling method on a COM interface. This happened due to unitialized local variable (gc_safe_transition_builder.coop_cominterop_fnptr) getting loaded when "need_gc_safe" is false. This caused the JIT to throw an InvalidOperationException. This fixes case UUM-62035. This bug was indirectly introduced by a previous pull request, which optimized interop call performance and made us take another code path which turned out not to work with COM interop: #1753.

  • Should this pull request have release notes?
    • Yes
    • No

Reviewers: please consider these questions as well! ❤️

Release notes

Fixed UUM-62035 @zilys
Mono: Fixed InvalidProgramException (Invalid IL code in (wrapper managed-to-native) : IL_0004: ldloc 65535)
getting thrown when calling COM interop methods,

Unity repository changes

I added a test for this change on this branch: https://github.cds.internal.unity3d.com/unity/unity/commits/platform/windows/uum-62035. Preferably this test gets merged to trunk together with this bugfix.

…ling method on a COM interface. This happened due to unitialized local variable (gc_safe_transition_builder.coop_cominterop_fnptr) getting loaded when "need_gc_safe" is false. This caused the JIT to throw an InvalidOperationException (case UUM-62035).
@unity-cla-assistant
Copy link
Collaborator

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TautvydasZilys TautvydasZilys merged commit 780f79f into unity-2023.3-mbe Mar 24, 2024
11 of 12 checks passed
@TautvydasZilys TautvydasZilys deleted the 2023.3/platform/windows/uum-62035 branch March 24, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants