Skip to content

Commit e621a36

Browse files
committed
Allow graph printing and JAR output
When Soot was set to output to a jar and graphs were to be printed simultaneously, only one would happen due to a naming conflict.
1 parent 62cbafe commit e621a36

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/soot/util/PhaseDumper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ private static java.io.File makeDirectoryIfMissing(Body b)
154154
throws java.io.IOException {
155155
StringBuffer buf =
156156
new StringBuffer(soot.SourceLocator.v().getOutputDir());
157+
158+
//If the options specify that the output directory should be a jar, we
159+
// must use a different directory for the graphs
160+
if(Options.v().output_jar()){
161+
if(buf.toString().endsWith(".jar")){
162+
buf.delete(buf.length()-4, buf.length());
163+
}
164+
buf.append(".graphs");
165+
}
166+
157167
buf.append(File.separatorChar);
158168
String className = b.getMethod().getDeclaringClass().getName();
159169
buf.append(className);

0 commit comments

Comments
 (0)