< prev index next >
src/hotspot/share/opto/macro.cpp
Print this page
rev 48500 : 8194988: 8 Null pointer dereference defect groups related to MultiNode::proj_out()
@@ -494,11 +494,11 @@
return new_phi;
if (level <= 0) {
return NULL; // Give up: phi tree too deep
}
- Node *start_mem = C->start()->proj_out(TypeFunc::Memory);
+ Node *start_mem = C->start()->proj_out_or_null(TypeFunc::Memory);
Node *alloc_mem = alloc->in(TypeFunc::Memory);
uint length = mem->req();
GrowableArray <Node *> values(length, length, NULL, false);
@@ -574,11 +574,11 @@
int instance_id = adr_t->instance_id();
assert((uint)instance_id == alloc->_idx, "wrong allocation");
int alias_idx = C->get_alias_index(adr_t);
int offset = adr_t->offset();
- Node *start_mem = C->start()->proj_out(TypeFunc::Memory);
+ Node *start_mem = C->start()->proj_out_or_null(TypeFunc::Memory);
Node *alloc_ctrl = alloc->in(TypeFunc::Control);
Node *alloc_mem = alloc->in(TypeFunc::Memory);
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
@@ -972,12 +972,12 @@
}
return true;
}
static void disconnect_projections(MultiNode* n, PhaseIterGVN& igvn) {
- Node* ctl_proj = n->proj_out(TypeFunc::Control);
- Node* mem_proj = n->proj_out(TypeFunc::Memory);
+ Node* ctl_proj = n->proj_out_or_null(TypeFunc::Control);
+ Node* mem_proj = n->proj_out_or_null(TypeFunc::Memory);
if (ctl_proj != NULL) {
igvn.replace_node(ctl_proj, n->in(0));
}
if (mem_proj != NULL) {
igvn.replace_node(mem_proj, n->in(TypeFunc::Memory));
@@ -1084,16 +1084,16 @@
uint oc1 = _resproj->outcnt();
if (use->is_Initialize()) {
// Eliminate Initialize node.
InitializeNode *init = use->as_Initialize();
assert(init->outcnt() <= 2, "only a control and memory projection expected");
- Node *ctrl_proj = init->proj_out(TypeFunc::Control);
+ Node *ctrl_proj = init->proj_out_or_null(TypeFunc::Control);
if (ctrl_proj != NULL) {
assert(init->in(TypeFunc::Control) == _fallthroughcatchproj, "allocation control projection");
_igvn.replace_node(ctrl_proj, _fallthroughcatchproj);
}
- Node *mem_proj = init->proj_out(TypeFunc::Memory);
+ Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
if (mem_proj != NULL) {
Node *mem = init->in(TypeFunc::Memory);
#ifdef ASSERT
if (mem->is_MergeMem()) {
assert(mem->in(TypeFunc::Memory) == _memproj_fallthrough, "allocation memory projection");
@@ -1196,11 +1196,11 @@
return true;
}
bool PhaseMacroExpand::eliminate_boxing_node(CallStaticJavaNode *boxing) {
// EA should remove all uses of non-escaping boxing node.
- if (!C->eliminate_boxing() || boxing->proj_out(TypeFunc::Parms) != NULL) {
+ if (!C->eliminate_boxing() || boxing->proj_out_or_null(TypeFunc::Parms) != NULL) {
return false;
}
assert(boxing->result_cast() == NULL, "unexpected boxing node result");
@@ -1578,12 +1578,12 @@
// Add the MemBarStoreStore after the InitializeNode so that
// all stores performing the initialization that were moved
// before the InitializeNode happen before the storestore
// barrier.
- Node* init_ctrl = init->proj_out(TypeFunc::Control);
- Node* init_mem = init->proj_out(TypeFunc::Memory);
+ Node* init_ctrl = init->proj_out_or_null(TypeFunc::Control);
+ Node* init_mem = init->proj_out_or_null(TypeFunc::Memory);
MemBarNode* mb = MemBarNode::make(C, Op_MemBarStoreStore, Compile::AliasIdxBot);
transform_later(mb);
Node* ctrl = new ProjNode(init,TypeFunc::Control);
< prev index next >