11package soot .jimple .infoflow ;
22
3+ import java .util .Map ;
4+
5+ import soot .Body ;
36import soot .Local ;
47import soot .Singletons .Global ;
58import soot .jimple .internal .JimpleLocal ;
69import 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 */
1419public 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