Review request (XS): NPG: oopDesc::list_ptr_from_klass is broken

Stefan Karlsson stefan.karlsson at oracle.com
Tue Sep 4 11:07:44 UTC 2012


http://cr.openjdk.java.net/~stefank/7195968/webrev/

Removed an incorrect cast.

 From the bug report:
With the following code in list_ptr_from_klass:
if (UseCompressedKlassPointers) {
return (oop)decode_heap_oop((oop)(address)_metadata._compressed_klass);

The _compressed_klass is casted to an oop, before being passed to 
decode_heap_oop. Because of this we call the wrong version of 
decode_heap_oop and fail to unpack the narrowOop.

This is a benign bug since this code path is never used. However, GCC 
4.6 complains with:
oop.inline.hpp: In member function ‘oopDesc* 
oopDesc::list_ptr_from_klass()’:
oop.inline.hpp:138:57: error: cast to pointer from integer of different 
size [-Werror=int-to-pointer-cast]

StefanK



More information about the hotspot-gc-dev mailing list