use of soot.jimple.spark.pag.ArrayElement in project soot by Sable.
the class InnerTypesIncrementalHeuristic method validFromBothEnds.
public boolean validFromBothEnds(SparkField field) {
if (allNotBothEnds) {
return false;
}
if (field instanceof ArrayElement) {
return true;
}
SootField sootField = (SootField) field;
RefType declaringType = sootField.getDeclaringClass().getType();
if (bothEndsTypes.contains(declaringType)) {
return true;
} else if (notBothEndsTypes.contains(declaringType)) {
return false;
} else {
if (SootUtil.hasRecursiveField(declaringType.getSootClass())) {
notBothEndsTypes.add(declaringType);
return false;
} else {
bothEndsTypes.add(declaringType);
return true;
}
}
}
use of soot.jimple.spark.pag.ArrayElement in project soot by Sable.
the class InnerTypesIncrementalHeuristic method validateMatchesForField.
public boolean validateMatchesForField(SparkField field) {
if (field instanceof ArrayElement) {
return true;
}
SootField sootField = (SootField) field;
RefType declaringType = sootField.getDeclaringClass().getType();
String declaringTypeStr = declaringType.toString();
String topLevel = Util.topLevelTypeString(declaringTypeStr);
RefType refType;
if (Scene.v().containsType(topLevel)) {
refType = Scene.v().getRefType(topLevel);
} else {
refType = null;
}
for (RefType checkedType : typesToCheck) {
if (manager.castNeverFails(checkedType, refType)) {
// System.err.println("validate " + declaringTypeStr);
return true;
}
}
if (newTypeOnQuery == null) {
newTypeOnQuery = declaringTypeStr;
}
return false;
}
use of soot.jimple.spark.pag.ArrayElement 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;
}
use of soot.jimple.spark.pag.ArrayElement 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;
}
Aggregations