about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWilliam Bruneau <william.bruneau@epfedu.fr>2017-10-09 14:32:10 +0200
committerWilliam Bruneau <william.bruneau@epfedu.fr>2018-03-12 10:36:52 +0100
commitc446bdf327ae279b18596c750db45d93618f7269 (patch)
treec5acb70fcfd6da45ad458d4763c7097f4d0b7d02
parent09d29b690cebfab06cb0b6cc0d0a615f9eb01227 (diff)
downloadmiasm-c446bdf327ae279b18596c750db45d93618f7269.tar.gz
miasm-c446bdf327ae279b18596c750db45d93618f7269.zip
Do not use current address to compute path for the new solution
When using path coverage strategy we do not want to include the current
address in the path that will be reached by the new solution.  Indeed,
'destination' is the address that we could have reached instead of the
current address using the new solution.
Diffstat (limited to '')
-rw-r--r--miasm2/analysis/dse.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/analysis/dse.py b/miasm2/analysis/dse.py
index 7f132c25..4762dd08 100644
--- a/miasm2/analysis/dse.py
+++ b/miasm2/analysis/dse.py
@@ -531,7 +531,10 @@ class DSEPathConstraint(DSEEngine):
         elif self._produce_solution_strategy == self.PRODUCE_SOLUTION_PATH_COV:
             # Decision based on path coverage
             # -> produce a solution if the current path has never been take
-            key = tuple(self._history + [destination])
+            # Note: we are taking all steps of the current history but the last
+            # one ([:-1]) because destination is a step that will replace the
+            # one we just made.
+            key = tuple(self._history[:-1] + [destination])
         else:
             raise ValueError("Unknown produce solution strategy")