public void setOpType(Type t) { opType = t; if (opType instanceof NullType || opType instanceof ArrayType || opType instanceof RefType) { opType = RefType.v(); } }
public void caseExitMonitorInst(ExitMonitorInst i) { remove_types = new Type[] { RefType.v("java.lang.Object") }; add_types = null; } }
AbstractOpTypeBranchInst(Type opType, UnitBox targetBox) { super(targetBox); if (opType instanceof NullType || opType instanceof ArrayType || opType instanceof RefType) { opType = RefType.v(); } this.opType = opType; }
public void setOpType(Type t) { opType = t; if (opType instanceof NullType || opType instanceof ArrayType || opType instanceof RefType) { opType = RefType.v(); } }
@Override public RefType boxedType() { return RefType.v("java.lang.Short"); } }
public GlobalNodeFactory(PAG pag) { this.pag = pag; this.rtObject = RefType.v("java.lang.Object"); this.rtClassLoader = RefType.v("java.lang.ClassLoader"); this.rtString = RefType.v("java.lang.String"); this.rtThread = RefType.v("java.lang.Thread"); this.rtThreadGroup = RefType.v("java.lang.ThreadGroup"); this.rtThrowable = RefType.v("java.lang.Throwable"); }
@Override public RefType boxedType() { return RefType.v("java.lang.Float"); } }
public Type getArrayElementType() { if (className.equals("java.lang.Object") || className.equals("java.io.Serializable") || className.equals("java.lang.Cloneable")) { return RefType.v("java.lang.Object"); } throw new RuntimeException("Attempt to get array base type of a non-array"); }
public void outAClassNameBaseType(AClassNameBaseType node) { String type = (String) mProductions.removeLast(); if (type.equals("int")) { throw new RuntimeException(); } mProductions.addLast(RefType.v(type)); }
/** * Create a RefType for a class. * * @param c * A SootClass for which to create a RefType. * @return a RefType for the given SootClass.. */ public static RefType v(SootClass c) { return v(c.getName()); }
/** * Converts a type descriptor to a Jimple reference type. * * @param desc * the descriptor. * @return the reference type. */ public static Type toJimpleRefType(String desc) { return desc.charAt(0) == '[' ? toJimpleType(desc) : RefType.v(toQualifiedName(desc)); }
public SootMethod getMainMethod() { if (!hasMainClass()) { throw new RuntimeException("There is no main class set!"); } SootMethod mainMethod = mainClass.getMethodUnsafe("main", Collections.<Type>singletonList(ArrayType.v(RefType.v("java.lang.String"), 1)), VoidType.v()); if (mainMethod == null) { throw new RuntimeException("Main class declares no main method!"); } return mainMethod; }
@Override public void caseThrowStmt(ThrowStmt stmt) { // add constraint DalvikTyper.v().setType(stmt.getOpBox(), RefType.v("java.lang.Object"), true); }
@Override public void visitOuterClass(String owner, String name, String desc) { if (name != null) { klass.addTag(new EnclosingMethodTag(owner, name, desc)); } owner = AsmUtil.toQualifiedName(owner); deps.add(RefType.v(owner)); klass.setOuterClass(SootResolver.v().makeClassRef(owner)); }
public void caseExitMonitorStmt(ExitMonitorStmt stmt) { if (uses) { if (stmt.getOp() instanceof Local) { TypeVariable op = resolver.typeVariable((Local) stmt.getOp()); op.addParent(resolver.typeVariable(RefType.v("java.lang.Object"))); } } }
public void caseEnterMonitorStmt(EnterMonitorStmt stmt) { if (uses) { if (stmt.getOp() instanceof Local) { TypeVariable op = resolver.typeVariable((Local) stmt.getOp()); op.addParent(resolver.typeVariable(RefType.v("java.lang.Object"))); } } }
public void caseExitMonitorStmt(ExitMonitorStmt stmt) { if (uses) { if (stmt.getOp() instanceof Local) { TypeVariableBV op = resolver.typeVariable((Local) stmt.getOp()); op.addParent(resolver.typeVariable(RefType.v("java.lang.Object"))); } } }
public void caseThrowStmt(ThrowStmt stmt) { if (stmt.getOp() instanceof Local) { TypeNode op = hierarchy.typeNode(((Local) stmt.getOp()).getType()); if (!op.hasAncestorOrSelf(hierarchy.typeNode(RefType.v("java.lang.Throwable")))) { if (fix) { stmt.setOp(insertCast((Local) stmt.getOp(), RefType.v("java.lang.Throwable"), stmt)); } else { error("Type Error(53)"); } } } }
private void assign_types_3() throws TypeException { for (Iterator<Local> localIt = stmtBody.getLocals().iterator(); localIt.hasNext();) { final Local local = localIt.next(); TypeVariable var = typeVariable(local); if (var == null || var.approx() == null || var.approx().type() == null) { local.setType(RefType.v("java.lang.Object")); } else { local.setType(var.approx().type()); } } }
public void caseExitMonitorStmt(ExitMonitorStmt stmt) { if (stmt.getOp() instanceof Local) { TypeNode op = hierarchy.typeNode(((Local) stmt.getOp()).getType()); if (!op.hasAncestorOrSelf(hierarchy.typeNode(RefType.v("java.lang.Object")))) { error("Type Error(49)"); } } }