Skip to content

Commit

Permalink
Increased stack and integer set limits (previous limits, 0.90)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincenzoArceri committed Feb 13, 2024
1 parent fae1372 commit 58eab0d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/it/unipr/analysis/AbstractStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.function.Predicate;

public class AbstractStack implements ValueDomain<AbstractStack>, BaseLattice<AbstractStack> {
public static final int STACK_LIMIT = 64;
public static final int STACK_LIMIT = 72;
private static final AbstractStack BOTTOM = new AbstractStack(null);

private final LinkedList<KIntegerSet> stack;
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/it/unipr/analysis/EVMAbstractState.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ public EVMAbstractState smallStepSemantics(ValueExpression expression, ProgramPo
// Above, operators that do not perform pop()

// from here on, top is propagated
if (isTop())
return this;
// if (isTop())
// return this;

// Below, operators that perform pop operation on the stack
switch (op.getClass().getSimpleName()) {
Expand Down Expand Up @@ -985,7 +985,8 @@ public EVMAbstractState smallStepSemantics(ValueExpression expression, ProgramPo

if (!(expression instanceof Skip))
throw new SemanticException("Reachable just with the skip node");
return this;

return top();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/it/unipr/analysis/KIntegerSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class KIntegerSet extends SetLattice<KIntegerSet, BigDecimal> {
private static final BigDecimal MAX = new BigDecimal(Math.pow(2, 256));
public static final int K = 4;
public static final int K = 15;

public static final KIntegerSet ZERO = new KIntegerSet(0);
public static final KIntegerSet ONE = new KIntegerSet(1);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/it/unipr/checker/JumpSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ public boolean visit(
}

KIntegerSet topStack = valueState.getTop();
if (topStack.isTop() || topStack.isBottom()) {
if (topStack.isBottom()) {
this.unreachableJumps.add(node);
continue;
} else if (topStack.isTop()) {
System.err.println(((ProgramCounterLocation) node.getLocation()).getSourceCodeLine() + " "
+ valueState.getStack());
continue;
Expand Down

0 comments on commit 58eab0d

Please sign in to comment.