Skip to content

Add missing convertArgs for primitive field setters in MethodHandle#13042

Open
blogcin wants to merge 2 commits intooracle:masterfrom
blogcin:master
Open

Add missing convertArgs for primitive field setters in MethodHandle#13042
blogcin wants to merge 2 commits intooracle:masterfrom
blogcin:master

Conversation

@blogcin
Copy link

@blogcin blogcin commented Feb 24, 2026

Fixes #12596

The REF_putField and REF_putStatic branches in
Util_java_lang_invoke_MethodHandle.invokeInternal(...) call
checkArgs(...) but skip convertArgs(args, methodType), so boxed
arguments are never unboxed before reaching the field accessor.
Every other invocation branch already calls convertArgs(...).

This patch adds the missing convertArgs(...) call in both branches
and includes a regression test (GitHub12596) that covers boolean,
byte, short, and char fields for both instance and static cases.

I have signed the OCA (currently under review).

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Feb 24, 2026
@oracle-contributor-agreement
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GR-71699][Native Image] Invoking setter MethodHandle with Boolean fails.

3 participants