about summary refs log tree commit diff stats
path: root/miasm2/ir/symbexec_top.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /miasm2/ir/symbexec_top.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'miasm2/ir/symbexec_top.py')
-rw-r--r--miasm2/ir/symbexec_top.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/miasm2/ir/symbexec_top.py b/miasm2/ir/symbexec_top.py
index be48c065..a1a255f8 100644
--- a/miasm2/ir/symbexec_top.py
+++ b/miasm2/ir/symbexec_top.py
@@ -1,3 +1,5 @@
+from future.utils import viewitems
+
 from miasm2.ir.symbexec import SymbolicExecutionEngine, StateEngine
 from miasm2.expression.simplifications import expr_simp
 from miasm2.expression.expression import ExprId, ExprInt, ExprSlice,\
@@ -16,7 +18,7 @@ def exprid_top(expr):
 class SymbolicStateTop(StateEngine):
 
     def __init__(self, dct, regstop):
-        self._symbols = frozenset(dct.items())
+        self._symbols = frozenset(viewitems(dct))
         self._regstop = frozenset(regstop)
 
     def __hash__(self):
@@ -52,8 +54,8 @@ class SymbolicStateTop(StateEngine):
         """
         symb_a = self.symbols
         symb_b = other.symbols
-        intersection = set(symb_a.keys()).intersection(symb_b.keys())
-        diff = set(symb_a.keys()).union(symb_b.keys()).difference(intersection)
+        intersection = set(symb_a).intersection(symb_b)
+        diff = set(symb_a).union(symb_b).difference(intersection)
         symbols = {}
         regstop = set()
         for dst in diff: