}
// See if there are any definitely-null values in the frame
for (int j = 0; j < slots; j++) {
IsNullValue isNullValue = invFrame.getValue(j);
ValueNumber valueNumber = vnaFrame.getValue(j);
if ((isNullValue.isDefinitelyNull() || isNullValue.isNullOnSomePath() && isNullValue.isReturnValue())
&& (derefSet.isUnconditionallyDereferenced(valueNumber))) {
if (MY_DEBUG) {
System.out.println("Found NP bug");
System.out.println("Location: " + thisLocation);
System.out.println("Value number frame: " + vnaFrame);
System.out.println("Value number: " + valueNumber);
System.out.println("IsNullValue frame: " + invFrame);
System.out.println("IsNullValue value: " + isNullValue);
System.out.println("Unconditional dere framef: " + derefSet);
System.out.println("Unconditionally dereferenced: " + derefSet.isUnconditionallyDereferenced(valueNumber));
}
Location where = thisLocation;
if (!isEdge && isNullValue.isNullOnSomePath() && isNullValue.isReturnValue()) {
try {
where = classContext.getCFG(method).getPreviousLocation(where);
} catch (CFGBuilderException e) {
AnalysisContext.logError(
"Error looking for previous instruction to " + where + " in "
+ classContext.getFullyQualifiedMethodName(method), e);
}
}
noteUnconditionallyDereferencedNullValue(where, knownNullAndDoomedAt, nullValueGuaranteedDerefMap, derefSet,
isNullValue, valueNumber);
}
}
// See if there are any known-null values in the heap that
// will be dereferenced in the future.
for (Map.Entry<ValueNumber, IsNullValue> entry : invFrame.getKnownValueMapEntrySet()) {
ValueNumber valueNumber = entry.getKey();
IsNullValue isNullValue = entry.getValue();
if ((isNullValue.isDefinitelyNull() || isNullValue.isNullOnSomePath()
&& (isNullValue.isReturnValue() || isNullValue.isFieldValue()))
&& derefSet.isUnconditionallyDereferenced(valueNumber)) {