IfInstruction branchInstruction = (IfInstruction) branch.getHandle().getInstruction();
IsNullValueDataflow isNullValueDataflow = getClassContext().getIsNullValueDataflow(getMethod());
ValueNumberDataflow valueNumberDataflow = getClassContext().getValueNumberDataflow(getMethod());
UnconditionalValueDerefDataflow unconditionalValueDerefDataflow = getClassContext()
.getUnconditionalValueDerefDataflow(getMethod());
ValueNumberFrame valueNumberFact = valueNumberDataflow.getFactAtLocation(produced);
IsNullValueFrame isNullFact = isNullValueDataflow.getFactAtLocation(produced);
ValueNumber value = valueNumberFact.getTopValue();
if (isNullFact.getTopValue().isDefinitelyNotNull()) {
return;
}
if (DEBUG) {
System.out.println("Produced: " + produced);
System.out.println(valueNumberFact);
System.out.println(isNullFact);
System.out.println("value: " + value);
System.out.println("branch: " + branch);
System.out.println("instruction: " + branchInstruction);
System.out.println("target: " + branchInstruction.getTarget());
System.out.println("next: " + branch.getHandle().getNext());
}
Location guaranteed = findLocation(cfg, nullGuaranteesBranch ? branchInstruction.getTarget() : branch.getHandle()
.getNext());
if (guaranteed == null) {
return;
}
UnconditionalValueDerefSet unconditionalDeref = unconditionalValueDerefDataflow.getFactAtLocation(guaranteed);
if (DEBUG) {
System.out.println("Guaranteed on null: " + guaranteed);
System.out.println(unconditionalDeref);
}