[9] RFR: 8175345: possible null pointer dereference defects
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Mar 9 01:24:05 UTC 2017
callnode.cpp - proj_out() is expensive. I would suggest to check returns_pointer() first:
Node* proj = returns_pointer() ? proj_out(TypeFunc::Parms) : NULL;
if (proj != NULL) {
const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
Other files changes are fine.
thanks,
Vladimir
On 3/7/17 10:53 PM, Rahul Raghavan wrote:
> Hi,
>
> Please review following patch proposal to avoid
> possible null pointer dereference warnings / errors for internal tests.
>
> <webrev.01> - http://cr.openjdk.java.net/~rraghavan/8175345/webrev.01/
>
>
> <jbs> - internal bug - https://bugs.openjdk.java.net/browse/JDK-8175345
>
> -- Possible null-pointer-deref type issues reported with Internal tests
> due to the case that "Function MultiNode::proj_out may return constant 'NULL'"
>
> Already following type checks are in place -
> .e.g.: [hotspot/src/share/vm/opto/multnode.cp]
> bool ProjNode::is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason) {
>
> ProjNode* other_proj = iff->proj_out(1-_con);
> if (other_proj == NULL) // Should never happen..
> return false;
>
> So required explicit checks added at following reported locations in <webrev.01>,
> - IfNode::dominated_by - hotspot/src/share/vm/opto/ifnode.cpp
> - StringConcat::validate_control_flow - hotspot/src/share/vm/opto/stringopts.cpp
> - PhaseIdealLoop::intrinsify_fill - hotspot/src/share/vm/opto/loopTransform.cpp
> - CallNode::may_modify - hotspot/src/share/vm/opto/callnode.cpp
>
> -- Found all valid reported defects issues with internal tests are indirectly related to above.
> -- Confirmed no issues with testing - jprt run (-testset hotspot).
>
>
> Thanks,
> Rahul
>
More information about the hotspot-compiler-dev
mailing list