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

Coleen Phillimore coleen.phillimore at
Tue Sep 4 11:39:04 UTC 2012

This looks good.   Please check this into hotspot-gc before the full 
integration up to hotspot-main if possible.

On 9/4/2012 7:07 AM, Stefan Karlsson wrote:
> 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