mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-03 01:02:37 +00:00
8133719: java.lang.InternalError in java.lang.invoke.MethodHandleImpl$BindCaller.bindCaller
Reviewed-by: psandoz
This commit is contained in:
parent
789f9198c7
commit
3e6e13dece
@ -1147,12 +1147,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
static
|
||||
MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
|
||||
// Do not use this function to inject calls into system classes.
|
||||
// Code in the the boot layer should now be careful while creating method handles or
|
||||
// functional interface instances created from method references to @CallerSensitive methods,
|
||||
// it needs to be ensured the handles or interface instances are kept safe and are not passed
|
||||
// from the boot layer to untrusted code.
|
||||
if (hostClass == null
|
||||
|| (hostClass.isArray() ||
|
||||
hostClass.isPrimitive() ||
|
||||
hostClass.getName().startsWith("java.") ||
|
||||
hostClass.getName().startsWith("sun."))) {
|
||||
hostClass.getName().startsWith("java.lang.invoke."))) {
|
||||
throw new InternalError(); // does not happen, and should not anyway
|
||||
}
|
||||
// For simplicity, convert mh to a varargs-like method.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user