This commit is contained in:
Jesper Wilhelmsson 2019-06-20 02:10:53 +02:00
commit 333c0c2453
9 changed files with 108 additions and 36 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -602,7 +602,7 @@ JDWP "Java(tm) Debug Wire Protocol"
(Command Signature=1
"Returns the JNI signature of a reference type. "
"JNI signature formats are described in the "
"<a href=\"http://java.sun.com/products/jdk/1.2/docs/guide/jni/index.html\">Java Native Inteface Specification</a>"
"<a href=\"../jni/index.html\">Java Native Interface Specification</a>"
"<p>
"For primitive classes "
"the returned signature is the signature of the corresponding primitive "

View File

@ -4958,6 +4958,7 @@ void ClassFileParser::verify_legal_utf8(const unsigned char* buffer,
bool ClassFileParser::verify_unqualified_name(const char* name,
unsigned int length,
int type) {
if (length == 0) return false; // Must have at least one char.
for (const char* p = name; p != name + length; p++) {
switch(*p) {
case '.':
@ -5107,7 +5108,7 @@ const char* ClassFileParser::skip_over_field_signature(const char* signature,
int newlen = c - (char*) signature;
bool legal = verify_unqualified_name(signature, newlen, LegalClass);
if (!legal) {
classfile_parse_error("Class name contains illegal character "
classfile_parse_error("Class name is empty or contains illegal character "
"in descriptor in class file %s",
CHECK_0);
return NULL;

View File

@ -147,16 +147,16 @@ vmTestbase/vm/mlvm/anonloader/stress/oome/metaspace/Test.java 8186299 gener
# jvmti tests
vmTestbase/nsk/jvmti/PopFrame/popframe009/TestDescription.java 8195639 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java 8195674 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java 8195674 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java 8195674,8195635 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java 8195674,8195635 generic-all
runtime/appcds/cacheObject/RedefineClassTest.java 8204506 macosx-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java 8204506 macosx-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java 8204506,8195635 macosx-all,generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java 8204506 macosx-all
vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java 8207013 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java 8207013 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java 8207013 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java 8207013,8195635 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java 8207013,8195635 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java 8207013,8195635 generic-all
vmTestbase/nsk/jvmti/StopThread/stopthrd007/TestDescription.java 8207013 generic-all
serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java 8202482 generic-all
@ -181,14 +181,8 @@ vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn001/TestDescription.java
vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn002/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jdi/stress/serial/mixed002/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java 8195635 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t007/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/TestDescription.java 8195635 generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.java 8195635 generic-all

View File

@ -49,8 +49,8 @@ compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
compiler/tiered/LevelTransitionTest.java 8067651 generic-all
compiler/types/correctness/CorrectnessTest.java 8225620 solaris-sparcv9
compiler/types/correctness/OffTest.java 8225620 solaris-sparcv9
compiler/types/correctness/CorrectnessTest.java 8225670,8225620 generic-all,solaris-sparcv9
compiler/types/correctness/OffTest.java 8225670,8225620 generic-all,solaris-sparcv9
compiler/c2/Test6852078.java 8194310 generic-all
compiler/c2/Test8004741.java 8214904 generic-all

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
super public class EmptyUnqName version 56:0 {
public Method "<init>":"()V" stack 1 locals 1 {
aload_0;
invokespecial Method java/lang/Object."<init>":"()V";
return;
}
public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
ldc String "Testing method param types";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
return;
}
public static Method func:"(L;)V" stack 0 locals 1 {
return;
}
} // end Class EmptyUnqName

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8225789
* @summary Test that an unqualified name of "L;" causes a ClassFormatError exception.
* @compile EmptyUnqName.jasm
* @run main/othervm -Xverify:remote TestEmptyUnqName
*/
public class TestEmptyUnqName {
public static void main(String args[]) throws Throwable {
System.out.println("Regression test for bug 8225789");
try {
Class newClass = Class.forName("EmptyUnqName");
throw new RuntimeException("Expected ClassFormatError exception not thrown");
} catch (java.lang.ClassFormatError e) {
if (!e.getMessage().contains("Class name is empty or contains illegal character")) {
throw new RuntimeException("Wrong ClassFormatError: " + e.getMessage());
}
}
}
}

View File

@ -63,7 +63,7 @@ public class TestSigParse {
throw new RuntimeException("Expected ClasFormatError exception not thrown");
} catch (java.lang.ClassFormatError e) {
String eMsg = e.getMessage();
if (!eMsg.contains("Class name contains illegal character")) {
if (!eMsg.contains("Class name is empty or contains illegal character")) {
throw new RuntimeException("Unexpected exception: " + eMsg);
}
}

View File

@ -30,3 +30,5 @@
java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java 8222445 windows-x64
java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java 8222445 windows-x64
java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java 8222445 windows-x64
java/lang/reflect/PublicMethods/PublicMethodsTest.java 8226309 generic-all
java/lang/constant/MethodTypeDescTest.java 8225349 windows-x64

View File

@ -78,27 +78,13 @@ java/lang/Runtime/exec/LotsOfOutput.java 8196611
java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java 8196611 generic-all
# tests require pop_frame and force_early_return capabilities
com/sun/jdi/RedefineTTYLineNumber.java 8195635 generic-all
com/sun/jdi/RedefineG.java 8195635 generic-all
com/sun/jdi/RedefineCrossStart.java 8195635 generic-all
com/sun/jdi/PopSynchronousTest.java 8195635 generic-all
com/sun/jdi/RedefineTTYLineNumber.java 8195635 generic-all
com/sun/jdi/RedefineG.java 8195635 generic-all
com/sun/jdi/RedefineCrossStart.java 8195635 generic-all
com/sun/jdi/PopSynchronousTest.java 8195635 generic-all
com/sun/jdi/PopAsynchronousTest.java 8195635 generic-all
com/sun/jdi/EarlyReturnTest.java 8195635 generic-all
com/sun/jdi/PopAndStepTest.java 8195635 generic-all
com/sun/jdi/PopAsynchronousTest.java 8195635 generic-all
com/sun/jdi/PopAndStepTest.java 8195635 generic-all
com/sun/jdi/EarlyReturnTest.java 8195635 generic-all
com/sun/jdi/RedefineTTYLineNumber.java 8195635 generic-all
com/sun/jdi/RedefineG.java 8195635 generic-all
com/sun/jdi/RedefineCrossStart.java 8195635 generic-all
com/sun/jdi/PopSynchronousTest.java 8195635 generic-all
com/sun/jdi/PopAsynchronousTest.java 8195635 generic-all
com/sun/jdi/PopAndStepTest.java 8195635 generic-all
com/sun/jdi/EarlyReturnTest.java 8195635 generic-all
com/sun/jdi/EarlyReturnTest.java 8195635 generic-all
com/sun/jdi/RedefineCrossStart.java 8195635 generic-all
com/sun/jdi/RedefineG.java 8195635 generic-all
com/sun/jdi/RedefineTTYLineNumber.java 8195635 generic-all
# Next JFR tests fail with Graal. Assuming 8193210.
jdk/jfr/event/compiler/TestCodeSweeper.java 8193210 generic-all