Details
-
Enhancement
-
Status: Resolved
-
P4
-
Resolution: Fixed
-
16
-
b08
Description
http://hg.openjdk.java.net/jdk/jdk/file/a5852eb26137/src/hotspot/share/oops/symbol.cpp#l53
Symbol::Symbol(const u1* name, int length, int refcount) {
_hash_and_refcount = pack_hash_and_refcount((short)os::random(), refcount);
_length = length;
_body[0] = 0; // in case length == 0 <<<<<< HERE
for (int i = 0; i < length; i++) {
byte_at_put(i, name[i]);
}
}
Per Kim Barrett:
The first two elements of _body are used by identity_hash().
That seems like a possible reason to force initialization of both
elements, which currently isn't done for length <= 1. But maybe it
doesn't matter that identity_hash isn't consistent between processes,
in which case forcing the initialization of _body[0] also shouldn't
be needed.
Symbol::Symbol(const u1* name, int length, int refcount) {
_hash_and_refcount = pack_hash_and_refcount((short)os::random(), refcount);
_length = length;
_body[0] = 0; // in case length == 0 <<<<<< HERE
for (int i = 0; i < length; i++) {
byte_at_put(i, name[i]);
}
}
Per Kim Barrett:
The first two elements of _body are used by identity_hash().
That seems like a possible reason to force initialization of both
elements, which currently isn't done for length <= 1. But maybe it
doesn't matter that identity_hash isn't consistent between processes,
in which case forcing the initialization of _body[0] also shouldn't
be needed.
Attachments
Issue Links
- relates to
-
JDK-8247818 GCC 10 warning stringop-overflow with symbol code
-
- Resolved
-