Mercurial > hg > truffle
comparison src/share/vm/opto/superword.cpp @ 14503:4e7ee57b57bf
8010500: [parfait] Possible null pointer dereference at hotspot/src/share/vm/opto/loopnode.hpp
Summary: Added NULL check for loopnode() in get_pre_loop_end()
Reviewed-by: kvn, roland
author | adlertz |
---|---|
date | Wed, 26 Feb 2014 07:46:46 +0100 |
parents | de6a9e811145 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14502:2757a106eaa8 | 14503:4e7ee57b57bf |
---|---|
439 bool SuperWord::ref_is_alignable(SWPointer& p) { | 439 bool SuperWord::ref_is_alignable(SWPointer& p) { |
440 if (!p.has_iv()) { | 440 if (!p.has_iv()) { |
441 return true; // no induction variable | 441 return true; // no induction variable |
442 } | 442 } |
443 CountedLoopEndNode* pre_end = get_pre_loop_end(lp()->as_CountedLoop()); | 443 CountedLoopEndNode* pre_end = get_pre_loop_end(lp()->as_CountedLoop()); |
444 assert(pre_end != NULL, "we must have a correct pre-loop"); | |
444 assert(pre_end->stride_is_con(), "pre loop stride is constant"); | 445 assert(pre_end->stride_is_con(), "pre loop stride is constant"); |
445 int preloop_stride = pre_end->stride_con(); | 446 int preloop_stride = pre_end->stride_con(); |
446 | 447 |
447 int span = preloop_stride * p.scale_in_bytes(); | 448 int span = preloop_stride * p.scale_in_bytes(); |
448 | 449 |
1979 // (iv + k) mod vector_align == 0 | 1980 // (iv + k) mod vector_align == 0 |
1980 void SuperWord::align_initial_loop_index(MemNode* align_to_ref) { | 1981 void SuperWord::align_initial_loop_index(MemNode* align_to_ref) { |
1981 CountedLoopNode *main_head = lp()->as_CountedLoop(); | 1982 CountedLoopNode *main_head = lp()->as_CountedLoop(); |
1982 assert(main_head->is_main_loop(), ""); | 1983 assert(main_head->is_main_loop(), ""); |
1983 CountedLoopEndNode* pre_end = get_pre_loop_end(main_head); | 1984 CountedLoopEndNode* pre_end = get_pre_loop_end(main_head); |
1984 assert(pre_end != NULL, ""); | 1985 assert(pre_end != NULL, "we must have a correct pre-loop"); |
1985 Node *pre_opaq1 = pre_end->limit(); | 1986 Node *pre_opaq1 = pre_end->limit(); |
1986 assert(pre_opaq1->Opcode() == Op_Opaque1, ""); | 1987 assert(pre_opaq1->Opcode() == Op_Opaque1, ""); |
1987 Opaque1Node *pre_opaq = (Opaque1Node*)pre_opaq1; | 1988 Opaque1Node *pre_opaq = (Opaque1Node*)pre_opaq1; |
1988 Node *lim0 = pre_opaq->in(1); | 1989 Node *lim0 = pre_opaq->in(1); |
1989 | 1990 |
2143 if (!iffm->is_If()) return NULL; | 2144 if (!iffm->is_If()) return NULL; |
2144 Node *p_f = iffm->in(0); | 2145 Node *p_f = iffm->in(0); |
2145 if (!p_f->is_IfFalse()) return NULL; | 2146 if (!p_f->is_IfFalse()) return NULL; |
2146 if (!p_f->in(0)->is_CountedLoopEnd()) return NULL; | 2147 if (!p_f->in(0)->is_CountedLoopEnd()) return NULL; |
2147 CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd(); | 2148 CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd(); |
2148 if (!pre_end->loopnode()->is_pre_loop()) return NULL; | 2149 CountedLoopNode* loop_node = pre_end->loopnode(); |
2150 if (loop_node == NULL || !loop_node->is_pre_loop()) return NULL; | |
2149 return pre_end; | 2151 return pre_end; |
2150 } | 2152 } |
2151 | 2153 |
2152 | 2154 |
2153 //------------------------------init--------------------------- | 2155 //------------------------------init--------------------------- |