about summary refs log tree commit diff stats
path: root/miasm2/ir/translators/z3_ir.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--miasm2/ir/translators/z3_ir.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/ir/translators/z3_ir.py b/miasm2/ir/translators/z3_ir.py
index 04ed9332..564670a6 100644
--- a/miasm2/ir/translators/z3_ir.py
+++ b/miasm2/ir/translators/z3_ir.py
@@ -167,7 +167,10 @@ class TranslatorZ3(Translator):
                 else:
                     raise NotImplementedError("Unsupported OP yet: %s" % expr.op)
         elif expr.op == 'parity':
-            res = z3.Extract(0, 0, res)
+            arg = z3.Extract(7, 0, res)
+            res = z3.BitVecVal(1, 1)
+            for i in xrange(8):
+                res = res ^ z3.Extract(i, i, arg)
         elif expr.op == '-':
             res = -res
         else: