Skip to content

Commit bda7b9b

Browse files
authored
Merge pull request #2040 from MarcMil/nop-fix
Remove cg edges of deleted unreachable units
2 parents 343f850 + ce190f1 commit bda7b9b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/soot/jimple/toolkits/scalar/UnreachableCodeEliminator.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,16 @@ protected void internalTransform(Body body, String phaseName, Map<String, String
117117
}
118118

119119
Set<Unit> notReachable = null;
120-
if (verbose) {
121-
notReachable = new HashSet<Unit>();
122-
for (Unit u : units) {
123-
if (!reachable.contains(u)) {
120+
for (Unit u : units) {
121+
if (!reachable.contains(u)) {
122+
if (verbose) {
123+
if (notReachable == null) {
124+
notReachable = new HashSet<Unit>();
125+
}
124126
notReachable.add(u);
127+
}
128+
if (Scene.v().hasCallGraph()) {
129+
Scene.v().getCallGraph().removeAllEdgesOutOf(u);
125130
}
126131
}
127132
}

0 commit comments

Comments
 (0)