Review request (XS): NPG: oopDesc::list_ptr_from_klass is broken
Bengt Rutisson
bengt.rutisson at oracle.com
Tue Sep 4 11:44:11 UTC 2012
Stefan,
Looks good!
In the long run I think we should remove the dead code, but this is a
good fix for now.
Ship it!
Bengt
On 2012-09-04 13:07, Stefan Karlsson wrote:
> 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