Skip to content

Commit

Permalink
refactor solver
Browse files Browse the repository at this point in the history
  • Loading branch information
jay2013 committed Mar 21, 2022
1 parent a9bf23a commit 4075ac3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions qilin.core/src/qilin/core/solver/Solver.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

import java.util.*;

public final class Solver extends Propagator {
public class Solver extends Propagator {
private final TreeSet<ValNode> valNodeWorkList = new TreeSet<>();
private final PAG pag;
private final PTA pta;
Expand Down Expand Up @@ -279,14 +279,23 @@ private void activateConstraints(QueueReader<VirtualCallSite> newCalls, QueueRea
}
}

private void propagatePTS(final ValNode pointer, PointsToSetInternal other) {
protected void propagatePTS(final ValNode pointer, PointsToSetInternal other) {
final PointsToSetInternal addTo = pointer.makeP2Set();
if (addTo.addAll(other, null)) {
P2SetVisitor p2SetVisitor = new P2SetVisitor() {
@Override
public void visit(Node n) {
if(addTo.add(n)) {
returnValue = true;
}
}
};
other.forall(p2SetVisitor);
if (p2SetVisitor.getReturnValue()) {
valNodeWorkList.add(pointer);
}
}

private void propagatePTS(final ValNode pointer, AllocNode heap) {
protected void propagatePTS(final ValNode pointer, AllocNode heap) {
if (pointer.makeP2Set().add(heap)) {
valNodeWorkList.add(pointer);
}
Expand Down

0 comments on commit 4075ac3

Please sign in to comment.