8158571: Additional method handle validation
authormhaupt
Wed, 08 Jun 2016 21:45:34 +0100
changeset 39756 c50c31af8cd9
parent 39755 3924e70f9f08
child 39757 5f3e350ee13e
8158571: Additional method handle validation Reviewed-by: jrose, ahgross, mchung
jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Fri May 20 09:58:14 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Wed Jun 08 21:45:34 2016 +0100
@@ -3796,7 +3796,7 @@
         int filterValues = filterType.parameterCount();
         if (filterValues == 0
                 ? (rtype != void.class)
-                : (rtype != filterType.parameterType(0)))
+                : (rtype != filterType.parameterType(0) || filterValues != 1))
             throw newIllegalArgumentException("target and filter types do not match", targetType, filterType);
     }