Skip to content

8394468: Compiler Bug "Invalid pool entry" - #33555

Closed
dev-jonghoonpark wants to merge 2 commits into
openjdk:masterfrom
dev-jonghoonpark:JDK-8394468
Closed

dev-jonghoonpark wants to merge 2 commits into
openjdk:masterfrom
dev-jonghoonpark:JDK-8394468

Conversation

@dev-jonghoonpark

@dev-jonghoonpark dev-jonghoonpark commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes a bug caused by the workaround introduced in JDK-6587674.

Problem

When a constant conditional expression is folded and the remaining expression (the null literal) has type BOT, convert() skips the cast because of the BOT check added in JDK-6587674. As a result, the static type of the conditional expression (String) is lost.

Fix

The workaround in JDK-6587674 was meant to avoid convert() casting to the type of a discarded class. That case no longer occurs after JDK-8314621: noClassDefIn prevents a constant condition from being folded when the discarded branch contains a class declaration, so the type of a discarded class can no longer reach convert() as pt.

This PR therefore removes the workaround, changing

if (tree.type == pt || tree.type.hasTag(BOT))
    return tree;

to

if (tree.type == pt) return tree;

in convert().

Testing

  • Added a regression test based on the reproducer from the issue.
  • langtools_javac tests pass.
  • tier1 tests pass.


Progress

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

Issue

  • JDK-8394468: Compiler Bug "Invalid pool entry" (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 33555

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@bridgekeeper

bridgekeeper Bot commented Oct 25, 2026

Copy link
Copy Markdown

👋 Welcome back dev-jonghoonpark! 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 Oct 25, 2026 •

Copy link
Copy Markdown

@dev-jonghoonpark 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:

8394468: Compiler Bug "Invalid pool entry"

Reviewed-by: jlahoda

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

At the time when this comment was updated there had been 20 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@lahodaj) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk Bot added the compiler compiler-dev@openjdk.org label Oct 25, 2026
@openjdk

openjdk Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

@dev-jonghoonpark The following label will be automatically applied to this pull request:

  • compiler

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

@openjdk openjdk Bot added the rfr Pull request is ready for review label Oct 25, 2026
@dev-jonghoonpark dev-jonghoonpark changed the title JDK-8394468: fix compiler Bug 'Invalid pool entry' JDK-8394468: Compiler Bug "Invalid pool entry" Oct 25, 2026
@openjdk openjdk Bot changed the title JDK-8394468: Compiler Bug "Invalid pool entry" 8394468: Compiler Bug "Invalid pool entry" Oct 25, 2026
@mlbridge

mlbridge Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Webrevs

@lahodaj lahodaj 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.

The fix seems sensible to me. But I would suggest to enhance the test, and also run the resulting class and verify behavior. Thanks!

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>

@lahodaj lahodaj 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.

Looks good to me, thanks!

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Oct 26, 2026
@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Oct 26, 2026
@openjdk

openjdk Bot commented Oct 26, 2026

Copy link
Copy Markdown

@dev-jonghoonpark
Your change (at version 5d037c4) is now ready to be sponsored by a Committer.

@openjdk openjdk Bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels Oct 26, 2026
@lahodaj

lahodaj commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

/sponsor

@openjdk

openjdk Bot commented Oct 27, 2026

Copy link
Copy Markdown

Going to push as commit a0340ff.
Since your change was applied there have been 29 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Oct 27, 2026
@openjdk openjdk Bot closed this Oct 27, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 27, 2026
@openjdk

openjdk Bot commented Oct 27, 2026

Copy link
Copy Markdown

@lahodaj @dev-jonghoonpark Pushed as commit a0340ff.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants