We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f2636d commit a96de6dCopy full SHA for a96de6d
src/hotspot/share/code/vtableStubs.cpp
@@ -262,7 +262,8 @@ inline uint VtableStubs::unsafe_hash(address entry_point) {
262
address vtable_type_addr = vtable_stub_addr + offset_of(VtableStub, _type);
263
address vtable_index_addr = vtable_stub_addr + offset_of(VtableStub, _index);
264
bool is_vtable_stub = *vtable_type_addr == static_cast<uint8_t>(VtableStub::Type::vtable_stub);
265
- int vtable_index;
+ short vtable_index;
266
+ static_assert(sizeof(VtableStub::_index) == sizeof(vtable_index), "precondition");
267
memcpy(&vtable_index, vtable_index_addr, sizeof(vtable_index));
268
return hash(is_vtable_stub, vtable_index);
269
}
0 commit comments