use of soot.AnySubType in project soot by Sable.
the class TypeManager method get.
public final BitVector get(Type type) {
if (type == null)
return null;
while (allocNodeListener.hasNext()) {
AllocNode n = allocNodeListener.next();
for (final Type t : Scene.v().getTypeNumberer()) {
if (!(t instanceof RefLikeType))
continue;
if (t instanceof AnySubType)
continue;
if (isUnresolved(t))
continue;
if (castNeverFails(n.getType(), t)) {
BitVector mask = typeMask.get(t);
if (mask == null) {
typeMask.put(t, mask = new BitVector());
for (final AllocNode an : pag.getAllocNodeNumberer()) {
if (castNeverFails(an.getType(), t)) {
mask.set(an.getNumber());
}
}
continue;
}
mask.set(n.getNumber());
}
}
}
BitVector ret = (BitVector) typeMask.get(type);
if (ret == null && fh != null) {
// If we have a phantom class and have no type mask, we assume that
// it is not cast-compatible to anything
SootClass curClass = ((RefType) type).getSootClass();
if (type instanceof RefType && curClass.isPhantom())
return new BitVector();
else {
// Scan through the hierarchy. We might have a phantom class higher up
while (curClass.hasSuperclass()) {
curClass = curClass.getSuperclass();
if (type instanceof RefType && curClass.isPhantom())
return new BitVector();
}
throw new RuntimeException("Type mask not found for type " + type);
}
}
return ret;
}
Aggregations