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

[TWR] AIOOB in compiler.codegen.ExceptionLabel.placeEnd when using try block with resources #3258

Open
srikanth-sankaran opened this issue Nov 6, 2024 · 0 comments
Assignees

Comments

@srikanth-sankaran
Copy link
Contributor

Found during code review: This program triggers an AIOOB in compiler.codegen.ExceptionLabel.placeEnd

I could observe it all the way back to 4.15, but problem likely goes back much farther back in time:

public class X implements AutoCloseable {

	public void close() throws Exception {}

	public static void foo(String[] args) {

		for (String arg : args) {
			try (X x = new X()) {
				if (args.length < 1) {
					System.out.println("if");
					break;
				} else {
					System.out.println("else");
					break;
				}
			} finally {
        	    System.out.println("finally");
        	    break;
			}
		}
	}

	public static void main(String[] args) {
		foo(new String[] { "Hello", "World" });
	}
}
@srikanth-sankaran srikanth-sankaran changed the title [TWR] AIOOB [TWR] AIOOB in compiler.codegen.ExceptionLabel.placeEnd when using try block with resources Nov 6, 2024
@srikanth-sankaran srikanth-sankaran self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant