bug fix to handle array types correctly
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1992 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
851aec7d00
commit
72b99ed91f
|
@ -57,7 +57,8 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
|
|||
/**
|
||||
* @param klasses
|
||||
* Collection<IClass>
|
||||
* @throws AssertionError if klasses is null
|
||||
* @throws AssertionError
|
||||
* if klasses is null
|
||||
*/
|
||||
private TypeBasedPointerAnalysis(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg) throws AssertionError {
|
||||
super(cg, makeInstanceKeys(klasses));
|
||||
|
@ -104,7 +105,8 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
|
|||
}
|
||||
|
||||
/**
|
||||
* Compute the set of {@link InstanceKey}s which may represent a particular type.
|
||||
* Compute the set of {@link InstanceKey}s which may represent a particular
|
||||
* type.
|
||||
*/
|
||||
private OrdinalSet<InstanceKey> computeOrdinalInstanceSet(IClass type) {
|
||||
Collection<IClass> klasses = null;
|
||||
|
@ -119,12 +121,18 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
|
|||
}
|
||||
}
|
||||
}
|
||||
klasses = HashSetFactory.make(klasses);
|
||||
klasses.retainAll(this.klasses);
|
||||
OrdinalSet<InstanceKey> result = toOrdinalInstanceKeySet(klasses);
|
||||
return result;
|
||||
Collection<IClass> c = HashSetFactory.make();
|
||||
for (IClass klass : klasses) {
|
||||
if (klass.isArrayClass()) {
|
||||
c.add(klass);
|
||||
} else if (this.klasses.contains(klass)) {
|
||||
c.add(klass);
|
||||
}
|
||||
|
||||
}
|
||||
OrdinalSet<InstanceKey> result = toOrdinalInstanceKeySet(c);
|
||||
return result;
|
||||
}
|
||||
|
||||
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection c) {
|
||||
BimodalMutableIntSet s = new BimodalMutableIntSet();
|
||||
|
|
Loading…
Reference in New Issue