diff options
| author | Ajax <commial@gmail.com> | 2017-03-29 15:09:23 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-03-30 16:04:40 +0200 |
| commit | 056d8496468f36e9388588e3e28bb2379403eb80 (patch) | |
| tree | c601457c227af71a60d61c9576b9220144c5091e /miasm2/expression/simplifications_common.py | |
| parent | cedf19e7d73ca8d603f2e1ed7f5306db27678e65 (diff) | |
| download | miasm-056d8496468f36e9388588e3e28bb2379403eb80.tar.gz miasm-056d8496468f36e9388588e3e28bb2379403eb80.zip | |
Let ExprInt always use its Singleton capabilities
Remove the optionnal 'size' argument form, use pointer equality to speed up comparision
Diffstat (limited to 'miasm2/expression/simplifications_common.py')
| -rw-r--r-- | miasm2/expression/simplifications_common.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/expression/simplifications_common.py b/miasm2/expression/simplifications_common.py index 503a0e77..c9b7932a 100644 --- a/miasm2/expression/simplifications_common.py +++ b/miasm2/expression/simplifications_common.py @@ -3,6 +3,7 @@ # ----------------------------- # +from miasm2.expression.modint import mod_size2int, mod_size2uint from miasm2.expression.expression import * from miasm2.expression.expression_helper import * @@ -103,7 +104,7 @@ def simp_cst_propagation(e_s, e): # -(int) => -int if op == '-' and len(args) == 1 and args[0].is_int(): - return ExprInt(-args[0].arg) + return ExprInt(-int(args[0]), e.size) # A op 0 =>A if op in ['+', '|', "^", "<<", ">>", "<<<", ">>>"] and len(args) > 1: if args[-1].is_int(0): @@ -237,7 +238,7 @@ def simp_cst_propagation(e_s, e): # parity(int) => int if op == 'parity' and args[0].is_int(): - return ExprInt1(parity(args[0].arg)) + return ExprInt1(parity(int(args[0]))) # (-a) * b * (-c) * (-d) => (-a) * b * c * d if op == "*" and len(args) > 1: |