< prev index next >

src/hotspot/share/opto/multnode.cpp

Print this page
rev 48500 : 8194988: 8 Null pointer dereference defect groups related to MultiNode::proj_out()

*** 1,7 **** /* ! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 41,52 **** } Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } //------------------------------proj_out--------------------------------------- ! // Get a named projection ! ProjNode* MultiNode::proj_out(uint which_proj) const { assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2, "bad if #1"); for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { Node *p = fast_out(i); if (p->is_Proj()) { --- 41,52 ---- } Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } //------------------------------proj_out--------------------------------------- ! // Get a named projection or null if not found ! ProjNode* MultiNode::proj_out_or_null(uint which_proj) const { assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2, "bad if #1"); for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { Node *p = fast_out(i); if (p->is_Proj()) {
*** 61,70 **** --- 61,77 ---- } } return NULL; } + // Get a named projection + ProjNode* MultiNode::proj_out(uint which_proj) const { + ProjNode* p = proj_out_or_null(which_proj); + assert(p != NULL, "named projection %u not found", which_proj); + return p; + } + //============================================================================= //------------------------------ProjNode--------------------------------------- uint ProjNode::hash() const { // only one input return (uintptr_t)in(TypeFunc::Control) + (_con << 1) + (_is_io_use ? 1 : 0);
*** 212,223 **** return NULL; } } ProjNode* other_proj = iff->proj_out(1-_con); - if (other_proj == NULL) // Should never happen, but make Parfait happy. - return NULL; CallStaticJavaNode* call = other_proj->is_uncommon_trap_proj(reason); if (call != NULL) { assert(reason == Deoptimization::Reason_none || Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); return call; --- 219,228 ----
< prev index next >