Skip to content

Commit 94c8d80

Browse files
committed
SONARJAVA-1389 SE: cache count of visits access.
1 parent 8b5b6b0 commit 94c8d80

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

java-squid/src/main/java/org/sonar/java/se/ExplodedGraphWalker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public void enqueue(ExplodedGraph.ProgramPoint programPoint, ProgramState progra
485485
throw new ExplodedGraphTooBigException("Program state constraints are too big : stopping Symbolic Execution for method "
486486
+ methodTree.simpleName().name() + "in class " + methodTree.symbol().owner().name());
487487
}
488-
ExplodedGraph.Node cachedNode = explodedGraph.getNode(programPoint, programState.visitingPoint(programPoint));
488+
ExplodedGraph.Node cachedNode = explodedGraph.getNode(programPoint, programState.visitedPoint(programPoint, nbOfExecution + 1));
489489
if (!cachedNode.isNew) {
490490
// has been enqueued earlier
491491
return;

java-squid/src/main/java/org/sonar/java/se/ProgramState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ public void accept(Symbol symbol, SymbolicValue value) {
197197
return reachable[0];
198198
}
199199

200-
public ProgramState visitingPoint(ExplodedGraph.ProgramPoint programPoint) {
201-
return new ProgramState(values, constraints, visitedPoints.put(programPoint, numberOfTimeVisited(programPoint) + 1), stack);
200+
public ProgramState visitedPoint(ExplodedGraph.ProgramPoint programPoint, int nbOfVisit) {
201+
return new ProgramState(values, constraints, visitedPoints.put(programPoint, nbOfVisit), stack);
202202
}
203203

204204
@CheckForNull

0 commit comments

Comments
 (0)