diff options
| author | Florent Monjalet <florent.monjalet@gmail.com> | 2015-03-24 00:16:03 +0100 |
|---|---|---|
| committer | Florent Monjalet <florent.monjalet@gmail.com> | 2015-03-24 00:16:03 +0100 |
| commit | 001472b1cd3c89ebf60a86d29ae7d843d5e453db (patch) | |
| tree | 9b6fcd2430721c1918edd6f25d15af89eb08d8a2 /miasm2/ir/translators/z3_ir.py | |
| parent | a8ece9f5c56334c37caafb9eddcd38081d6b4464 (diff) | |
| download | miasm-001472b1cd3c89ebf60a86d29ae7d843d5e453db.tar.gz miasm-001472b1cd3c89ebf60a86d29ae7d843d5e453db.zip | |
TranslatorZ3: Fixed parity semantic
Diffstat (limited to 'miasm2/ir/translators/z3_ir.py')
| -rw-r--r-- | miasm2/ir/translators/z3_ir.py | 5 |
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: |