Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8247818: GCC 10 warning stringop-overflow with symbol code
Browse files Browse the repository at this point in the history
Backport-of: ed31b66
  • Loading branch information
Yuri Nesterenko committed Sep 9, 2022
1 parent 6ce4b72 commit f9c77a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 1 addition & 3 deletions src/hotspot/share/oops/symbol.cpp
Expand Up @@ -52,9 +52,7 @@ uint32_t Symbol::pack_length_and_refcount(int length, int refcount) {
Symbol::Symbol(const u1* name, int length, int refcount) {
_length_and_refcount = pack_length_and_refcount(length, refcount);
_identity_hash = (short)os::random();
for (int i = 0; i < length; i++) {
byte_at_put(i, name[i]);
}
memcpy(_body, name, length);
}

void* Symbol::operator new(size_t sz, int len) throw() {
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/oops/symbol.hpp
Expand Up @@ -126,11 +126,6 @@ class Symbol : public MetaspaceObj {
return (int)heap_word_size(byte_size(length));
}

void byte_at_put(int index, u1 value) {
assert(index >=0 && index < length(), "symbol index overflow");
_body[index] = value;
}

Symbol(const u1* name, int length, int refcount);
void* operator new(size_t size, int len) throw();
void* operator new(size_t size, int len, Arena* arena) throw();
Expand Down

1 comment on commit f9c77a7

@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.