[Java.Interop] Fix RawCallStaticObjectMethodA PInvoke call#1411
Open
jonathanpeppers wants to merge 1 commit intomainfrom
Open
[Java.Interop] Fix RawCallStaticObjectMethodA PInvoke call#1411jonathanpeppers wants to merge 1 commit intomainfrom
jonathanpeppers wants to merge 1 commit intomainfrom
Conversation
Remove undeclared `instance` variable from the PInvoke path in RawCallStaticObjectMethodA. The call was passing 6 arguments to a 5-parameter PInvoke: (env, out thrown, clazz, instance, jmethodID, args). This is currently dead code since modern builds use function pointers (FEATURE_JNIENVIRONMENT_JI_FUNCTION_POINTERS), but would cause a compilation error if the PInvoke path is ever re-enabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes an incorrect P/Invoke invocation in the FEATURE_JNIENVIRONMENT_JI_PINVOKES path for RawCallStaticObjectMethodA by removing an extra (undeclared) instance argument so the call matches the native signature.
Changes:
- Remove the stray
instanceargument fromjava_interop_jnienv_call_static_object_method_ainvocation inRawCallStaticObjectMethodA. - Ensure the P/Invoke call argument list aligns with the native API (
env,thrown,clazz,jmethodID,args).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove undeclared
instancevariable from the PInvoke path inRawCallStaticObjectMethodA. The call was passing 6 arguments to a 5-parameter PInvoke:(env, out thrown, clazz, instance, jmethodID, args).The correct call should only pass:
(env, out thrown, clazz, jmethodID, args).Context
Found while investigating the
Mono.Android.NET_Tests-Debugtest failure in dotnet/android#11171. The test failure itself appears to be a flaky emulator reboot (lowmemorykiller dropped, SystemServer restarted) — not caused by the Java.Interop changes. However, this latent bug was introduced in #1410 and should be fixed.This is currently dead code since modern builds use function pointers (
FEATURE_JNIENVIRONMENT_JI_FUNCTION_POINTERS), but would cause a compilation error if the PInvoke path (FEATURE_JNIENVIRONMENT_JI_PINVOKES) is ever re-enabled.