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

8255531: MethodHandles::permuteArguments throws NPE when duplicating dropped arguments #2054

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -301,7 +301,7 @@ LambdaForm endEdit() {
int argp = firstChange, exprp = 0;
for (int i = firstChange; i < arity; i++) {
Name name = names[i];
if (name.isParam()) {
if (name != null && name.isParam()) {
names[argp++] = name;
} else {
exprs[exprp++] = name;
@@ -63,6 +63,8 @@ public void testPermuteArguments0() throws Throwable {
testBadReorderIndex();
testReturnTypeMismatch();
testReorderTypeMismatch();

testPermuteWithEmpty();
}

public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) throws Throwable {
@@ -227,6 +229,12 @@ public void testReorderTypeMismatch() throws Throwable {
IllegalArgumentException.class, ".*parameter types do not match after reorder.*");
}

// for JDK-8255531
private void testPermuteWithEmpty() {
MethodHandle mh = MethodHandles.empty(MethodType.methodType(void.class, int.class, int.class));
MethodHandles.permuteArguments(mh, MethodType.methodType(void.class, int.class), 0, 0);
}

private interface RunnableX {
void run() throws Throwable;
}
ProTip! Use n and p to navigate between commits in a pull request.