Skip to content

Conversation

@liach
Copy link
Member

@liach liach commented Mar 24, 2025

In LambdaToMethod, when a type annotation is attributed to a lambda's synthetic method or the original method, the annotation's position is queried. However, for container annotations, their positions may not yet be up-to-date, and they are wrongly attributed to the outer method.

This bug was discovered because this wrong attribution can bring in an invalid BCI value referring to a lambda method code array that may be out-of-bounds for the outer method. CombinationTargetTest3 had to stay on the old internal proprietary classfile API due to this reason, as the ClassFile API throws an IAE for such a malformed type annotation attribute.

Please review this patch; this is a blocker for the removal of com.sun.tools.classfile from the JDK, which I wish to accomplish when the boot JDK is 24.

Testing: langtools/tools/javac and javap.


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-8315447: Invalid Type Annotation attached to a method instead of a lambda (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24206

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 24, 2025

👋 Welcome back liach! 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
Copy link

openjdk bot commented Mar 24, 2025

@liach 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:

8315447: Invalid Type Annotation attached to a method instead of a lambda

Reviewed-by: vromero

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 1 new commit pushed to the master branch:

  • 6e6a39d: 8347321: [ubsan] CGGlyphImages.m:553:30: runtime error: nan is outside the range of representable values of type 'unsigned long'

Please see this link for an up-to-date comparison between the source branch of this pull request and 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 24, 2025
@openjdk
Copy link

openjdk bot commented Mar 24, 2025

@liach 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 compiler compiler-dev@openjdk.org label Mar 24, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 24, 2025

Webrevs

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

looks sensible to me

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 24, 2025
@liach
Copy link
Member Author

liach commented Mar 25, 2025

Tier 1-3 tests pass.

@liach
Copy link
Member Author

liach commented Mar 25, 2025

Thanks for the reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Mar 25, 2025

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

  • 60544a1: 8164714: Constructor.newInstance creates instance of inner class with null outer class
  • c856b34: 8352587: C2 SuperWord: we must avoid Multiversioning for PeelMainPost loops
  • 993eae4: 8346948: Update CLDR to Version 47.0
  • e98838f: 8352065: [PPC64] C2: Implement PopCountVL, CountLeadingZerosV and CountTrailingZerosV nodes
  • 03105fc: 8351601: [JMH] test UnixSocketChannelReadWrite failed for 2 threads config
  • fe03e2e: 8351897: Extra closing curly brace typos in Javadoc
  • fa0b18b: 8352509: Update jdk.test.lib.SecurityTools jar method to accept List parameter
  • 3ac9678: 8351224: Deprecate com.sun.tools.attach.AttachPermission for removal
  • 997aa17: 8351310: Deprecate com.sun.jdi.JDIPermission for removal
  • c953e0e: 8350579: Remove Template Assertion Predicates belonging to a loop once it is folded away
  • ... and 21 more: https://git.openjdk.org/jdk/compare/b84b29278f710fabab703bc75dda1fa817bc13f6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 25, 2025
@openjdk openjdk bot closed this Mar 25, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 25, 2025
@openjdk
Copy link

openjdk bot commented Mar 25, 2025

@liach Pushed as commit f5a0db4.

💡 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