mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8261785: Calling "main" method in anonymous nested class crashes the JVM
Reviewed-by: serb
This commit is contained in:
parent
840ab7bf0f
commit
b2df51372f
3 changed files with 143 additions and 1 deletions
|
@ -827,7 +827,7 @@ SetMainClassForAWT(JNIEnv *env, jclass mainClass) {
|
|||
NULL_CHECK(getCanonicalNameMID = (*env)->GetMethodID(env, classClass, "getCanonicalName", "()Ljava/lang/String;"));
|
||||
|
||||
jstring mainClassString = (*env)->CallObjectMethod(env, mainClass, getCanonicalNameMID);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
if ((*env)->ExceptionCheck(env) || NULL == mainClassString) {
|
||||
/*
|
||||
* Clears all errors caused by getCanonicalName() on the mainclass and
|
||||
* leaves the JAVA_MAIN_CLASS__<pid> empty.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue