adapt to wala changes for cross-language call graphs
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1213 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
0ed8d96d55
commit
30f01f77a4
|
@ -1035,4 +1035,31 @@ public class PrimitivesTest extends WalaTestCase {
|
||||||
assertTrue(v2.isSubset(v1));
|
assertTrue(v2.isSubset(v1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSpecificBugsInSemiSparseMutableIntSets() {
|
||||||
|
SemiSparseMutableIntSet v1 = new SemiSparseMutableIntSet();
|
||||||
|
v1.add(54);
|
||||||
|
v1.add(58);
|
||||||
|
v1.add(59);
|
||||||
|
v1.add(64);
|
||||||
|
v1.add(67);
|
||||||
|
v1.add(73);
|
||||||
|
v1.add(83);
|
||||||
|
v1.add(105);
|
||||||
|
v1.add(110);
|
||||||
|
v1.add(126);
|
||||||
|
v1.add(136);
|
||||||
|
v1.add(143);
|
||||||
|
v1.add(150);
|
||||||
|
v1.add(155);
|
||||||
|
v1.add(156);
|
||||||
|
v1.add(162);
|
||||||
|
v1.add(168);
|
||||||
|
v1.add(183);
|
||||||
|
v1.add(191);
|
||||||
|
v1.add(265);
|
||||||
|
v1.add(294);
|
||||||
|
v1.add(324);
|
||||||
|
v1.add(344);
|
||||||
|
v1.add(397);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class PiNodeCallGraphTest extends WalaTestCase {
|
||||||
|
|
||||||
private static final String thatName = TestConstants.PI_TEST_MAIN + "$That";
|
private static final String thatName = TestConstants.PI_TEST_MAIN + "$That";
|
||||||
|
|
||||||
private static final ClassLoaderReference loader = new ClassLoaderReference(Atom.findOrCreateUnicodeAtom("Application"));
|
private static final ClassLoaderReference loader = ClassLoaderReference.Application;
|
||||||
|
|
||||||
private static final TypeReference whateverRef = TypeReference.findOrCreate(loader, TypeName.string2TypeName(whateverName));
|
private static final TypeReference whateverRef = TypeReference.findOrCreate(loader, TypeName.string2TypeName(whateverName));
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine {
|
||||||
//
|
//
|
||||||
// ...and the class hierarchy
|
// ...and the class hierarchy
|
||||||
//
|
//
|
||||||
ClassHierarchy cha = buildClassHierarchy();
|
IClassHierarchy cha = buildClassHierarchy();
|
||||||
setClassHierarchy(cha);
|
setClassHierarchy(cha);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -281,6 +281,15 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine {
|
||||||
return escapingTypes;
|
return escapingTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This main program shows one example use of thread escape
|
||||||
|
* analysis: producing a set of fields to be monitored for a
|
||||||
|
* dynamic race detector. The idea is that any field might have a
|
||||||
|
* race with two excpetions: final fields do not have races since
|
||||||
|
* there are no writes to them, and volatile fields have atomic read
|
||||||
|
* and write semantics provided by trhe VM. Hence, this piece of
|
||||||
|
* code produces a list of all other fields.
|
||||||
|
*/
|
||||||
public static void main(String[] args) throws IOException, ClassHierarchyException {
|
public static void main(String[] args) throws IOException, ClassHierarchyException {
|
||||||
String mainClassName = args[0];
|
String mainClassName = args[0];
|
||||||
|
|
||||||
|
@ -292,7 +301,13 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine {
|
||||||
Set<IClass> escapingTypes = (new SimpleThreadEscapeAnalysis(jars, mainClassName)).gatherThreadEscapingClasses();
|
Set<IClass> escapingTypes = (new SimpleThreadEscapeAnalysis(jars, mainClassName)).gatherThreadEscapingClasses();
|
||||||
|
|
||||||
for (Iterator<IClass> types = escapingTypes.iterator(); types.hasNext();) {
|
for (Iterator<IClass> types = escapingTypes.iterator(); types.hasNext();) {
|
||||||
System.out.println(types.next().getName().toString());
|
IClass cls = types.next();
|
||||||
|
for(Iterator fs = cls.getAllFields().iterator(); fs.hasNext(); ) {
|
||||||
|
IField f = (IField) fs.next();
|
||||||
|
if (!f.isVolatile() && !f.isFinal()) {
|
||||||
|
System.err.println( f.getReference() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue