Skip to content

Commit

Permalink
+throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nignag committed May 22, 2014
1 parent 0e99855 commit f4fb967
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/soot/toolkits/scalar/SmartLocalDefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,24 @@ protected StaticSingleAssignment(List<Unit>[] units, Local[] locals) {

@Override
public List<Unit> getDefsOfAt(Local l, Unit s) {
List<Unit> r = localToDefs.get(l);
if (r == null) {
r = emptyList();
for (ValueBox useBox : s.getUseBoxes()) {
if (l == useBox.getValue()) {
return getDefsOfAt(useBox);
}
}
return r;
throw new RuntimeException();
}

public List<Unit> getDefsOfAt(ValueBox valueBox) {
Value v = valueBox.getValue();
if (v instanceof Local) {
List<Unit> r = localToDefs.get(v);
if (r != null) {
return r;
if (r == null) {
return emptyList();
}
return r;
}
return emptyList();
throw new RuntimeException();
}
}

Expand Down Expand Up @@ -141,13 +143,17 @@ public List<Unit> getDefsOfAt(Local l, Unit s) {
return getDefsOfAt(useBox);
}
}
return emptyList();
throw new RuntimeException();
}

public List<Unit> getDefsOfAt(ValueBox valueBox) {
List<Unit> r = resultValueBoxes.get(valueBox);
if (r == null) {
r = emptyList();
Value v = valueBox.getValue();
if (v instanceof Local) {
return emptyList();
}
throw new RuntimeException();
}
return r;
}
Expand Down

0 comments on commit f4fb967

Please sign in to comment.