Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8236490: Compiler bug relating to @NonNull annotation #2060

Closed
wants to merge 1 commit into from

Conversation

lgxbslgx
Copy link
Member

@lgxbslgx lgxbslgx commented Jan 13, 2021

Hi all,

If the exception class index in constant pool exceeds 256, the exception_index in TypeAnnotationPosition will not work as expected. Please see the following code:

    public void setCatchInfo(final int catchType, final int startPos) {
        Assert.check(!hasExceptionIndex(),
                     "exception_index is already set");
        Assert.check(catchType >= 0, "Expected a valid catch type");
        this.exception_index = -((catchType | startPos << 8) + 1);  // <------------------------------
    }

If catchType > 256, which means the 8-15 bits is useful, the -((catchType | startPos << 8) + 1); would override these bits.

This patch separates the startPos into a new field exceptionStartPos to solve the bug. And a test case is added.

Thank you for taking the time to review.

Best Regards.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2060/head:pull/2060
$ git checkout pull/2060

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 13, 2021

👋 Welcome back lgxbslgx! 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 added the rfr Pull request is ready for review label Jan 13, 2021
@openjdk
Copy link

openjdk bot commented Jan 13, 2021

@lgxbslgx 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 Jan 13, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 13, 2021

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

@openjdk
Copy link

openjdk bot commented Jan 14, 2021

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

8236490: Compiler bug relating to @NonNull annotation

Reviewed-by: vromero, jfranck

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 207 new commits pushed to the master branch:

  • abd9310: 8260222: remove unused _thread member SymbolTableLookup
  • c538cd8: 8165276: Spec states to invoke the premain method in an agent class if it's public but implementation differs
  • 9ea9323: 8254246: SymbolHashMapEntry wastes space
  • 982e42b: 8259726: Use of HashSet leads to undefined order in test output
  • d6fb9d7: 8255464: Cannot access ModuleTree in a CompilationUnitTree
  • 12ccd21: 8260289: Unable to customize module lists after change JDK-8258411
  • 73c78c8: 8260329: Update references to TAOCP to latest edition
  • 5b0b24b: 8260381: ProblemList com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java on Win with ZGC
  • 47c7dc7: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures
  • ef247ab: 8260308: Update LogCompilation junit to 4.13.1
  • ... and 197 more: https://git.openjdk.java.net/jdk/compare/c338f1167f2ab0c1a35876419db914dce844d5e8...master

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 (@vicente-romero-oracle, @jbf) 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 ready Pull request is ready to be integrated label Jan 14, 2021
@lgxbslgx
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 14, 2021
@openjdk
Copy link

openjdk bot commented Jan 14, 2021

@lgxbslgx
Your change (at version cadf27c) is now ready to be sponsored by a Committer.

@lgxbslgx
Copy link
Member Author

@vicente-romero-oracle Could I get your help to sponsor this patch? Thanks a lot.

@jbf
Copy link
Member

jbf commented Jan 26, 2021

@lgxbslgx can you rebase on a fresh upstream and I'll sponsor this for you

Copy link
Member

@jbf jbf left a comment

Choose a reason for hiding this comment

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

I think is still trying to be way to clever with compressing the different states into previously 1 int and now 2 ints. However this is an improvement and fixes an issue we have.

@lgxbslgx
Copy link
Member Author

@jbf Thank you. The patch can be integrated directly because the robot doesn't remind of conflict.

@jbf
Copy link
Member

jbf commented Jan 26, 2021

/sponsor

@openjdk openjdk bot closed this Jan 26, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 26, 2021
@openjdk
Copy link

openjdk bot commented Jan 26, 2021

@jbf @lgxbslgx Since your change was applied there have been 207 commits pushed to the master branch:

  • abd9310: 8260222: remove unused _thread member SymbolTableLookup
  • c538cd8: 8165276: Spec states to invoke the premain method in an agent class if it's public but implementation differs
  • 9ea9323: 8254246: SymbolHashMapEntry wastes space
  • 982e42b: 8259726: Use of HashSet leads to undefined order in test output
  • d6fb9d7: 8255464: Cannot access ModuleTree in a CompilationUnitTree
  • 12ccd21: 8260289: Unable to customize module lists after change JDK-8258411
  • 73c78c8: 8260329: Update references to TAOCP to latest edition
  • 5b0b24b: 8260381: ProblemList com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java on Win with ZGC
  • 47c7dc7: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures
  • ef247ab: 8260308: Update LogCompilation junit to 4.13.1
  • ... and 197 more: https://git.openjdk.java.net/jdk/compare/c338f1167f2ab0c1a35876419db914dce844d5e8...master

Your commit was automatically rebased without conflicts.

Pushed as commit 23edb6f.

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

@lgxbslgx lgxbslgx deleted the JDK-8236490 branch January 26, 2021 08:58
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
3 participants