if (first == null) {
// All operands are void -- we're not ready to resolve yet
return false;
}
LocalItem firstLocal = first.getLocalItem();
TypeBearer mergedType = first.getType();
boolean sameLocals = true;
for (int i = 0 ; i < szSources ; i++) {
if (i == firstIndex) {
continue;
}
RegisterSpec rs = sources.get(i);
// Just skip void (unresolved phi results) for now
if (rs.getBasicType() == Type.BT_VOID){
continue;
}
sameLocals = sameLocals
&& equalsHandlesNulls(firstLocal, rs.getLocalItem());
mergedType = Merger.mergeType(mergedType, rs.getType());
}
TypeBearer newResultType;
if (mergedType != null) {
newResultType = mergedType;
} else {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < szSources; i++) {
sb.append(sources.get(i).toString());
sb.append(' ');
}
throw new RuntimeException ("Couldn't map types in phi insn:" + sb);
}
LocalItem newLocal = sameLocals ? firstLocal : null;
RegisterSpec result = insn.getResult();
if ((result.getTypeBearer() == newResultType)
&& equalsHandlesNulls(newLocal, result.getLocalItem())) {