Search in sources :

Example 71 with SootField

use of soot.SootField in project soot by Sable.

the class IncrementalTypesHeuristic method validFromBothEnds.

public boolean validFromBothEnds(SparkField field) {
    if (field instanceof SootField) {
        SootField sootField = (SootField) field;
        RefType declaringType = sootField.getDeclaringClass().getType();
        for (RefType type : notBothEndsTypes) {
            if (manager.castNeverFails(declaringType, type)) {
                return false;
            }
        }
    }
    return true;
}
Also used : RefType(soot.RefType) SootField(soot.SootField)

Example 72 with SootField

use of soot.SootField in project soot by Sable.

the class IncrementalTypesHeuristic method validateMatchesForField.

/*
     * (non-Javadoc)
     * 
     * @see AAA.algs.Heuristic#validateMatchesForField(soot.jimple.spark.pag.SparkField)
     */
public boolean validateMatchesForField(SparkField field) {
    // if (true) return true;
    if (field instanceof ArrayElement) {
        return true;
    }
    SootField sootField = (SootField) field;
    RefType declaringType = sootField.getDeclaringClass().getType();
    if (EXCLUDE_TYPES) {
        for (String typeName : EXCLUDED_NAMES) {
            if (Util.stringContains(declaringType.toString(), typeName)) {
                return false;
            }
        }
    }
    for (RefType typeToCheck : typesToCheck) {
        if (manager.castNeverFails(declaringType, typeToCheck)) {
            return true;
        }
    }
    if (newTypeOnQuery == null) {
        newTypeOnQuery = declaringType;
    // System.err.println("adding type " + declaringType);
    }
    // System.err.println("false for " + field);
    return false;
}
Also used : RefType(soot.RefType) SootField(soot.SootField) ArrayElement(soot.jimple.spark.pag.ArrayElement)

Example 73 with SootField

use of soot.SootField in project soot by Sable.

the class ManualFieldCheckHeuristic method validateMatchesForField.

public boolean validateMatchesForField(SparkField field) {
    if (field instanceof ArrayElement) {
        return true;
    }
    SootField sootField = (SootField) field;
    String fieldTypeStr = sootField.getDeclaringClass().getType().toString();
    for (String typeName : importantTypes) {
        if (fieldTypeStr.equals(typeName)) {
            return true;
        }
    }
    return false;
}
Also used : SootField(soot.SootField) ArrayElement(soot.jimple.spark.pag.ArrayElement)

Aggregations

SootField (soot.SootField)73 SootMethod (soot.SootMethod)29 SootClass (soot.SootClass)26 RefType (soot.RefType)22 ArrayList (java.util.ArrayList)19 Value (soot.Value)17 Iterator (java.util.Iterator)15 Local (soot.Local)14 Type (soot.Type)14 Unit (soot.Unit)13 FieldRef (soot.jimple.FieldRef)12 BooleanType (soot.BooleanType)10 PrimType (soot.PrimType)10 VoidType (soot.VoidType)10 Stmt (soot.jimple.Stmt)10 ByteType (soot.ByteType)8 CharType (soot.CharType)8 DoubleType (soot.DoubleType)8 FloatType (soot.FloatType)8 IntType (soot.IntType)8