diff options
| author | Florent Monjalet <florent.monjalet@gmail.com> | 2015-01-11 22:35:27 +0100 |
|---|---|---|
| committer | Florent Monjalet <florent.monjalet@gmail.com> | 2015-01-11 22:42:02 +0100 |
| commit | 817566b388a9a7a6b9c52700146d73e942eeb0c2 (patch) | |
| tree | df1fb5e6fefbd7e10e7ab7fd2d96dc87f712926f | |
| parent | 136520e4638bac0fa6d04bf502d8eec787bcee48 (diff) | |
| download | miasm-817566b388a9a7a6b9c52700146d73e942eeb0c2.tar.gz miasm-817566b388a9a7a6b9c52700146d73e942eeb0c2.zip | |
TranslatorPython: fix forgotten parenthesis could lead to errors
| -rw-r--r-- | miasm2/ir/translators/python.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/miasm2/ir/translators/python.py b/miasm2/ir/translators/python.py index 395e34cc..c3386980 100644 --- a/miasm2/ir/translators/python.py +++ b/miasm2/ir/translators/python.py @@ -57,7 +57,7 @@ class TranslatorPython(Translator): args[0], (1 << expr.size) - 1) else: - return "(%s & 0x%x)" % ((" %s " % expr.op).join(args), + return "((%s) & 0x%x)" % ((" %s " % expr.op).join(args), (1 << expr.size) - 1) elif expr.op == "parity": return "(%s & 0x1)" % cls.from_expr(expr.args[0]) |