Skip to content

Commit

Permalink
8255006: Add NULL-check to StringDedupTable lookup
Browse files Browse the repository at this point in the history
Reviewed-by: rkennke, kbarrett
  • Loading branch information
zhengyu123 committed Oct 20, 2020
1 parent ee6eb98 commit 856037c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -278,7 +278,7 @@ typeArrayOop StringDedupTable::lookup(typeArrayOop value, bool latin1, unsigned
if (entry->hash() == hash && entry->latin1() == latin1) {
oop* obj_addr = (oop*)entry->obj_addr();
oop obj = NativeAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(obj_addr);
if (java_lang_String::value_equals(value, static_cast<typeArrayOop>(obj))) {
if (obj != NULL && java_lang_String::value_equals(value, static_cast<typeArrayOop>(obj))) {
obj = NativeAccess<ON_PHANTOM_OOP_REF>::oop_load(obj_addr);
return static_cast<typeArrayOop>(obj);
}
Expand Down

1 comment on commit 856037c

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 856037c Oct 20, 2020

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.