Skip to content

Commit

Permalink
8298636: Fix return value in WB_CountAliveClasses and WB_GetSymbolRef…
Browse files Browse the repository at this point in the history
…count

Reviewed-by: dholmes
  • Loading branch information
albertnetymk committed Dec 14, 2022
1 parent ceca4fc commit 9ee5037
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/share/prims/whitebox.cpp
Expand Up @@ -207,7 +207,9 @@ class WBIsKlassAliveClosure : public LockedClassesDo {

WB_ENTRY(jint, WB_CountAliveClasses(JNIEnv* env, jobject target, jstring name))
oop h_name = JNIHandles::resolve(name);
if (h_name == NULL) return false;
if (h_name == NULL) {
return 0;
}
Symbol* sym = java_lang_String::as_symbol(h_name);
TempNewSymbol tsym(sym); // Make sure to decrement reference count on sym on return

Expand All @@ -220,7 +222,9 @@ WB_END

WB_ENTRY(jint, WB_GetSymbolRefcount(JNIEnv* env, jobject unused, jstring name))
oop h_name = JNIHandles::resolve(name);
if (h_name == NULL) return false;
if (h_name == NULL) {
return 0;
}
Symbol* sym = java_lang_String::as_symbol(h_name);
TempNewSymbol tsym(sym); // Make sure to decrement reference count on sym on return
return (jint)sym->refcount();
Expand Down

1 comment on commit 9ee5037

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.