Skip to content

Commit

Permalink
Conform to spec for MethodHandles::loop's with void return types
Browse files Browse the repository at this point in the history
This patch fixes eclipse-openj9/openj9#18293; which is really a
duplicate of eclipse-openj9/openj9#11937. 'loop' in OJDK MHs does not
conform to the spec w.r.t. setting loop finalizers for loop's with
void return types. This patch properly sets default finalizer values.

Closes: eclipse-openj9/openj9#18293
Signed-off-by: Nathan Henderson <[email protected]>
  • Loading branch information
ThanHenderson committed Oct 27, 2023
1 parent b404781 commit 7e14c9a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.invoke;

Expand Down Expand Up @@ -4896,7 +4901,7 @@ public static MethodHandle loop(MethodHandle[]... clauses) {
pred.set(i, dropArguments0(constant(boolean.class, true), 0, commonParameterSequence));
}
if (fini.get(i) == null) {
fini.set(i, empty(methodType(t, commonParameterSequence)));
fini.set(i, empty(methodType(loopReturnType, commonParameterSequence)));
}
}

Expand Down

0 comments on commit 7e14c9a

Please sign in to comment.