From: rtrimana Date: Fri, 19 Jun 2020 18:50:50 +0000 (-0700) Subject: Bug fix: when state is not found in rGraph, that means the state is being visited... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=commitdiff_plain;h=6c9a974109810a89b28711f0fa8b188a252c90a8 Bug fix: when state is not found in rGraph, that means the state is being visited and this is a loop (self-predecessor). --- diff --git a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java index ef0994c..13061d8 100644 --- a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java +++ b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java @@ -352,6 +352,10 @@ public class DPORStateReducer extends ListenerAdapter { return executionTrace.get(0); } + public TransitionEvent getLastTransition() { + return executionTrace.get(executionTrace.size() - 1); + } + public HashMap getReadWriteFieldsMap() { return readWriteFieldsMap; } @@ -421,6 +425,12 @@ public class DPORStateReducer extends ListenerAdapter { } public HashSet getReachableTransitionsAtState(int stateId) { + if (!graph.containsKey(stateId)) { + // This is a loop from a transition to itself, so just return the current transition + HashSet transitionSet = new HashSet<>(); + transitionSet.add(currentExecution.getLastTransition()); + return transitionSet; + } return graph.get(stateId); }