8194985: JavaAdapterBytecodeGenerator passes invalid type descriptor to ASM
Reviewed-by: sundar, attila
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Sat Jan 13 18:33:35 2018 -0500
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Mon Jan 15 11:07:41 2018 +0100
@@ -1083,7 +1083,7 @@
// Simply invoke super.finalize()
mv.visitVarInsn(ALOAD, 0);
- mv.checkcast(Type.getType(generatedClassName));
+ mv.checkcast(Type.getType('L' + generatedClassName + ';'));
mv.invokespecial(superClassName, "finalize", VOID_METHOD_DESCRIPTOR, false);
mv.visitInsn(RETURN);
--- a/test/nashorn/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java Sat Jan 13 18:33:35 2018 -0500
+++ b/test/nashorn/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java Mon Jan 15 11:07:41 2018 +0100
@@ -133,7 +133,7 @@
}
}
-
+ // This also covers overriding finalizer in JavaAdapter such as JDK-8194985
@Test
public void securitySystemExitFromFinalizerThread() throws ScriptException {
if (System.getSecurityManager() == null) {