Skip to content

8304694: Runtime exception thrown when break stmt is missing #13146

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

Closed
wants to merge 1 commit into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Mar 22, 2023

For code like this:

    public static int runFallThrough(R6 r) {
        switch (r) {
            case R6(var v1, var v2) when v1 != 0: return 0;
            case R6(var v1, var v2):
        }
        return 1;
    }

The execution falls through from the last case not outside the switch, but inside the fallback default case (that throws).

The current code is injecting breaks, but only for rule cases, and this situation where the last case needs a break is not handled. To simplify the code, it is now proposed to inject breaks at the beginning of the processing (rather than during processing/at the end) to all necessary cases.


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-8304694: Runtime exception thrown when break stmt is missing

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13146

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 22, 2023

👋 Welcome back jlahoda! 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 Mar 22, 2023
@openjdk
Copy link

openjdk bot commented Mar 22, 2023

@lahodaj 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 22, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 22, 2023

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 good

@openjdk
Copy link

openjdk bot commented Mar 22, 2023

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

8304694: Runtime exception thrown when break stmt is missing

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

  • e73411a: 8304376: Rename t1/t2 classes in com/sun/jdi/CLETest.java to avoid class duplication error in IDE
  • a2d8f63: 8288730: Add type parameter to Lookup::accessClass and Lookup::ensureInitialized
  • 3777455: 8302191: Performance degradation for float/double modulo on Linux
  • 760c012: 8304683: Memory leak in WB_IsMethodCompatible
  • 75168ea: 8304134: jib bootstrapper fails to quote filename when checking download filetype
  • 4154a98: 8301498: Replace NULL with nullptr in cpu/x86
  • ddf1e34: 8304089: Convert TraceDependencies to UL
  • 358c61b: 8294972: Convert jdk.jlink internal plugins to use the Classfile API
  • c74507e: 8304657: G1: Rename set_state_empty to set_state_untracked
  • ca94287: 8304144: G1: Remove unnecessary is_survivor check in G1ClearCardTableTask
  • ... and 48 more: https://git.openjdk.org/jdk/compare/620564ac6152be92c5fa83b474d30a43e698d51e...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.

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

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 22, 2023
@lahodaj
Copy link
Contributor Author

lahodaj commented Mar 27, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 27, 2023

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

  • 46b0602: 8304547: Remove checking of -Djava.compiler in src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java
  • 8d423f7: 8304723: Statically allocate global mutexes
  • 2083088: 8304828: Lots of constant static data not declared static const in cpu/x86
  • 0712adc: 7169951: SwingSet2 throws NullPointerException with Nimbus L&F
  • de1c12e: 8301012: [vectorapi]: Intrinsify CompressBitsV/ExpandBitsV and add the AArch64 SVE backend implementation
  • 10fa7d1: 8304804: Remove develop flag G1VerifyCTCleanup
  • 4acf20d: 8304809: Remove develop flag G1ExitOnExpansionFailure
  • a5ffa07: 7026262: HttpServer: improve handling of finished HTTP exchanges
  • 65e01da: 8304013: Add a fast, non-manual alternative to test/jdk/java/util/zip/ZipFile/TestTooManyEntries
  • 38e1714: 8304258: x86: Improve the code generation of VectorRearrange with int and float
  • ... and 90 more: https://git.openjdk.org/jdk/compare/620564ac6152be92c5fa83b474d30a43e698d51e...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 27, 2023

@lahodaj Pushed as commit 138cdc9.

💡 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