8246308: Reference count for PackageEntry::name may be incorrectly decremented

Corrected the usage of TempNewSymbol.

Reviewed-by: minqi, iklam
This commit is contained in:
Calvin Cheung 2020-07-13 16:05:25 +00:00
parent 097720cce5
commit 5146474954
2 changed files with 12 additions and 2 deletions

View file

@ -717,7 +717,7 @@ Handle SystemDictionaryShared::get_shared_jar_url(int shared_path_index, TRAPS)
Handle SystemDictionaryShared::get_package_name(Symbol* class_name, TRAPS) {
ResourceMark rm(THREAD);
Handle pkgname_string;
Symbol* pkg = ClassLoader::package_from_class_name(class_name);
TempNewSymbol pkg = ClassLoader::package_from_class_name(class_name);
if (pkg != NULL) { // Package prefix found
const char* pkgname = pkg->as_klass_external_name();
pkgname_string = java_lang_String::create_from_str(pkgname,