8228671: Fastdebug VM throws InternalError when publicLookup.in(T) is used to resolve a member
Reviewed-by: alanb
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Fri Jul 26 23:37:51 2019 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Sat Jul 27 14:49:16 2019 -0700
@@ -1329,7 +1329,14 @@
// This is just for calling out to MethodHandleImpl.
private Class<?> lookupClassOrNull() {
- return (allowedModes == TRUSTED) ? null : lookupClass;
+ if (allowedModes == TRUSTED) {
+ return null;
+ }
+ if (allowedModes == UNCONDITIONAL) {
+ // use Object as the caller to pass to VM doing resolution
+ return Object.class;
+ }
+ return lookupClass;
}
/** Tells which access-protection classes of members this lookup object can produce.