about summary refs log tree commit diff stats
path: root/miasm2/analysis/dse.py
diff options
context:
space:
mode:
authorWilliam Bruneau <william.bruneau@epfedu.fr>2017-10-09 14:21:26 +0200
committerWilliam Bruneau <william.bruneau@epfedu.fr>2018-03-12 10:36:52 +0100
commit09d29b690cebfab06cb0b6cc0d0a615f9eb01227 (patch)
tree8c06eccdfbbc72bd05bcb6b091e6d554ccf624b8 /miasm2/analysis/dse.py
parent6f43586f6e4e8314861b2ddadaba452b829be4c3 (diff)
downloadmiasm-09d29b690cebfab06cb0b6cc0d0a615f9eb01227.tar.gz
miasm-09d29b690cebfab06cb0b6cc0d0a615f9eb01227.zip
Reinitialize _history when restoring snapshot
Each time we restore a snapshot we want to restore _history.
If not done, each time we use restore_snapshot()
we continue appending the new _history to the old one.
Diffstat (limited to '')
-rw-r--r--miasm2/analysis/dse.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/miasm2/analysis/dse.py b/miasm2/analysis/dse.py
index d97897d8..7f132c25 100644
--- a/miasm2/analysis/dse.py
+++ b/miasm2/analysis/dse.py
@@ -493,6 +493,8 @@ class DSEPathConstraint(DSEEngine):
         snap["new_solutions"] = {dst: src.copy
                                  for dst, src in self.new_solutions.iteritems()}
         snap["cur_constraints"] = self.cur_solver.assertions()
+        if self._produce_solution_strategy == self.PRODUCE_SOLUTION_PATH_COV:
+            snap["_history"] = list(self._history)
         return snap
 
     def restore_snapshot(self, snapshot, keep_known_solutions=True, **kwargs):
@@ -507,6 +509,8 @@ class DSEPathConstraint(DSEEngine):
         self.cur_solver.add(snapshot["cur_constraints"])
         if not keep_known_solutions:
             self._known_solutions.clear()
+        if self._produce_solution_strategy == self.PRODUCE_SOLUTION_PATH_COV:
+            self._history = list(snapshot["_history"])
 
     def _key_for_solution_strategy(self, destination):
         """Return the associated identifier for the current solution strategy"""