RFR(XS) 8010500: [parfait] Possible null pointer dereference at hotspot/src/share/vm/opto/loopnode.hpp

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Feb 17 12:27:11 PST 2014

Note, the fix is not asserts changes but new check for NULL:

     CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
+   if (pre_end->loopnode() == NULL) return NULL;
     if (!pre_end->loopnode()->is_pre_loop()) return NULL;


On 2/17/14 12:04 PM, Vladimir Kozlov wrote:
> get_pre_loop_end() is called in 3 places during superword optimization. First time it is called during initialization of
> superword in transform_loop() where we bailout from the optimization if it is NULL:
>    // Check for pre-loop ending with CountedLoopEnd(Bool(Cmp(x,Opaque1(limit))))
>    CountedLoopEndNode* pre_end = get_pre_loop_end(cl);
>    if (pre_end == NULL) return;
> So it is fine to have asserts after that point in other call sites.
> Thanks,
> Vladimir
> On 2/17/14 11:58 AM, David Chase wrote:
>> I am not a Reviewer, but is this the best way to address a Parfait warning?
>> I don't see any reasoning, either in the bug report comments or in the patch, about how
>> the null pointer should not actually appear, and the assert merely changes one sort
>> of crash into another for debug and fastdebug builds.
>> David
>> On 2014-02-17, at 3:49 PM, Niclas Adlertz <niclas.adlertz at oracle.com> wrote:
>>> Hi all,
>>> Could I please have a review for this very small fix?
>>> http://cr.openjdk.java.net/~adlertz/JDK-8010500/webrev00/
>>> https://bugs.openjdk.java.net/browse/JDK-8010500
>>> Kind Regards,
>>> Niclas Adlertz

More information about the hotspot-compiler-dev mailing list