Skip to content

8389840: Verifier is not setting flagThisUninit when uninitializedThis is on the stack - #32242

Open
matias9927 wants to merge 6 commits into
openjdk:masterfrom
matias9927:flagThisUninit_8389840
Open

8389840: Verifier is not setting flagThisUninit when uninitializedThis is on the stack#32242
matias9927 wants to merge 6 commits into
openjdk:masterfrom
matias9927:flagThisUninit_8389840

Conversation

@matias9927

@matias9927 matias9927 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

JDK-8376522 indicates that the thisUninit should be applied even when uninitializedThis is on the stack. Previous implementations failed to do this, so this patch properly enforces this spec change.

Now that both the stack and locals must be considered when applying flagThisUninit, the origin of the flag needs to be preserved, so the StackMapReader now tracks if the flag originated from locals or the stack. Since the stack is cleared between frames, only an uninitializedThis from locals is preserved.

In addition to VM changes, the ClassFile API had to be updated as it only considered stack frame locals. The test case offered by @liach in the JBS issue has been adapted to a JASM test to verify the change. Verified with tier 1-5 tests.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8389840: Verifier is not setting flagThisUninit when uninitializedThis is on the stack (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32242/head:pull/32242
$ git checkout pull/32242

Update a local copy of the PR:
$ git checkout pull/32242
$ git pull https://git.openjdk.org/jdk.git pull/32242/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32242

View PR using the GUI difftool:
$ git pr show -t 32242

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32242.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

👋 Welcome back matsaave! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

@matias9927 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8389840: Verifier is not setting flagThisUninit when uninitializedThis is on the stack

Reviewed-by: liach, fparain

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 21 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@matias9927 matias9927 changed the title 8389840: Should set flagThisUninit whenever uninitializedThis is on the stack 8376522: Should set flagThisUninit whenever uninitializedThis is on the stack Aug 6, 2026
@openjdk openjdk Bot added hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Aug 6, 2026
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

@matias9927 The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-runtime. This can be overridden with the /reviewers command.

@matias9927 matias9927 changed the title 8376522: Should set flagThisUninit whenever uninitializedThis is on the stack 8389840: Verifier is not setting flagThisUninit when uninitializedThis is on the stack Aug 6, 2026

@liach liach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend the implementation to add a separate tracking flag for uninitializedThis on stack, because each stack map frame clears the previous stack.

Comment thread src/hotspot/share/classfile/stackMapTable.cpp Outdated
@liach

liach commented Aug 6, 2026

Copy link
Copy Markdown
Member

You can rollback the jdk/internal/classfile changes: They are fixed in #32224

@matias9927
matias9927 marked this pull request as ready for review August 7, 2026 17:21
@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 7, 2026
@mlbridge

mlbridge Bot commented Aug 7, 2026

Copy link
Copy Markdown

Webrevs

@liach liach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect, thank you so much!

@fparain fparain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants