Skip to content

Commit 579042f

Browse files
committed
Merge branch 'fix-flowdroid-bug' of github.com:MarcMil/FlowDroid into fix-flowdroid-bug
2 parents 79e3450 + 1c78376 commit 579042f

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

soot-infoflow/src/soot/jimple/infoflow/FlowDroidLocalSplitter.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package soot.jimple.infoflow;
22

3+
import java.util.Map;
4+
5+
import soot.Body;
36
import soot.Local;
47
import soot.Singletons.Global;
58
import soot.jimple.internal.JimpleLocal;
69
import soot.toolkits.scalar.LocalSplitter;
10+
import soot.toolkits.scalar.UnusedLocalEliminator;
711

812
/**
9-
* With more recent soot versions, locals are reused more often.
10-
* This can cause problems in FlowDroid (e.g. the overwriteParameter test case).
11-
* The simple solution: We split these locals beforehand
13+
* With more recent soot versions, locals are reused more often. This can cause
14+
* problems in FlowDroid (e.g. the overwriteParameter test case). The simple
15+
* solution: We split these locals beforehand
16+
*
1217
* @author Marc Miltenberger
1318
*/
1419
public class FlowDroidLocalSplitter extends LocalSplitter {
@@ -19,7 +24,7 @@ public static class SplittedLocal extends JimpleLocal {
1924

2025
public SplittedLocal(JimpleLocal oldLocal) {
2126
super(null, oldLocal.getType());
22-
//do not intern the name again
27+
// do not intern the name again
2328
setName(oldLocal.getName());
2429
if (oldLocal.isUserDefinedLocal()) {
2530
setUserDefinedLocal();
@@ -43,7 +48,7 @@ public FlowDroidLocalSplitter() {
4348

4449
@Override
4550
protected String getNewName(String name, int count) {
46-
//Reuse the old name
51+
// Reuse the old name
4752
return name;
4853
}
4954

@@ -56,4 +61,10 @@ public static FlowDroidLocalSplitter v() {
5661
return new FlowDroidLocalSplitter();
5762
}
5863

64+
@Override
65+
protected void internalTransform(Body body, String phaseName, Map<String, String> options) {
66+
super.internalTransform(body, phaseName, options);
67+
UnusedLocalEliminator.v().transform(body);
68+
}
69+
5970
}

0 commit comments

Comments
 (0)