From ffc8f17f159d60af9f0e2dea9bad0dac9875076d Mon Sep 17 00:00:00 2001 From: rtrimana Date: Thu, 9 Jul 2020 15:02:54 -0700 Subject: [PATCH] Generate a new RestorableVMState object only when it's still not available in the HashMap. --- src/main/gov/nasa/jpf/listener/DPORStateReducer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java index 3e387a9..363bc4b 100644 --- a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java +++ b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java @@ -652,8 +652,10 @@ public class DPORStateReducer extends ListenerAdapter { } currentExecution.mapCGToChoice(icsCG, choiceCounter); // Store restorable state object for this state (always store the latest) - RestorableVMState restorableState = vm.getRestorableState(); - restorableStateMap.put(stateId, restorableState); + if (!restorableStateMap.containsKey(stateId)) { + RestorableVMState restorableState = vm.getRestorableState(); + restorableStateMap.put(stateId, restorableState); + } } private TransitionEvent setupTransition(IntChoiceFromSet icsCG, int stateId, int choiceIndex) { -- 2.34.1