- // Perform this analysis only when there is a state match and state > 0 (state 0 is for boolean CG)
- if (!vm.isNewState() && (stateId > 0)) {
+ // Perform this analysis only when:
+ // 1) there is a state match,
+ // 2) this is not during a switch to a new execution,
+ // 3) at least 2 choices/events have been explored (choiceCounter > 1),
+ // 4) the matched state has been encountered in the current execution, and
+ // 5) state > 0 (state 0 is for boolean CG)
+ if (!vm.isNewState() && !isEndOfExecution && choiceCounter > 1 &&
+ currVisitedStates.contains(stateId) && (stateId > 0)) {