RFR (L, tedious) 8160399: is_oop_or_null involves undefined behavior

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Fri Aug 18 00:48:47 UTC 2017



On 8/17/17 7:47 PM, Kim Barrett wrote:
>> On Aug 17, 2017, at 7:30 PM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>>
>> Hi Coleen,
>>
>> Could you motivate why you changed is_oop() to a static functions?
> Quoting myself from a comment in 8160399:
>
> For it [is_oop] to fail one has to take a non-oop, make it appear to be an oop, and
> call an oop member function on that not really an oop. That sounds like UB to me.
>
>

Yes, and there is a linked bug about updating to a new version of gcc 
that (may have) optimized this undefined behavior.  So it's good to get 
it cleaned up before we go to C++11 or newer compilers.

https://bugs.openjdk.java.net/browse/JDK-8160363

thanks,
Coleen



More information about the hotspot-dev mailing list