Skip to content

Commit

Permalink
Add insertBeforeNoRedirect(List)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMil committed Dec 23, 2021
1 parent 0b57295 commit c8367fd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/soot/PatchingChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ public void insertBeforeNoRedirect(E toInsert, E point) {
innerChain.insertBefore(toInsert, point);
}

/** Inserts <code>toInsert</code> in the Chain before <code>point</code> WITHOUT redirecting jumps. */
public void insertBeforeNoRedirect(List<E> toInsert, E point) {
if (!toInsert.isEmpty()) {
// Insert toInsert backwards into the list
E previousPoint = point;
for (ListIterator<E> it = toInsert.listIterator(toInsert.size()); it.hasPrevious();) {
E o = it.previous();
insertBeforeNoRedirect(o, previousPoint);
previousPoint = o;
}
}
}

/** Returns true if object <code>a</code> follows object <code>b</code> in the Chain. */
@Override
public boolean follows(E a, E b) {
Expand Down

0 comments on commit c8367fd

Please sign in to comment.