diff options
| author | Camille Mougey <commial@gmail.com> | 2015-04-26 17:03:23 +0200 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2015-04-26 17:03:23 +0200 |
| commit | 4c16d4925c780242f99f693740a4eb6b34f7cf74 (patch) | |
| tree | 45248e8e196ad20c432bd7d69bedc468ab40c00c | |
| parent | 28a9e877943bc654481f4052ba608510460c4909 (diff) | |
| parent | 207d62c5d5d6b8b2f5a5e83bff8e85e137759321 (diff) | |
| download | miasm-4c16d4925c780242f99f693740a4eb6b34f7cf74.tar.gz miasm-4c16d4925c780242f99f693740a4eb6b34f7cf74.zip | |
Merge pull request #150 from serpilliere/fix_uint
Fix uint
| -rw-r--r-- | miasm2/expression/modint.py | 4 | ||||
| -rw-r--r-- | test/expression/simplifications.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/miasm2/expression/modint.py b/miasm2/expression/modint.py index ffe1574c..8bad5ccb 100644 --- a/miasm2/expression/modint.py +++ b/miasm2/expression/modint.py @@ -4,9 +4,7 @@ class moduint(object): def __init__(self, arg): - if isinstance(arg, moduint): - arg = arg.arg - self.arg = arg % self.__class__.limit + self.arg = long(arg) % self.__class__.limit assert(self.arg >= 0 and self.arg < self.__class__.limit) def __repr__(self): diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index e5bb109c..d3e1c979 100644 --- a/test/expression/simplifications.py +++ b/test/expression/simplifications.py @@ -198,7 +198,10 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)), (ExprCompose([(f[:32], 0, 32), (ExprInt32(0), 32, 64)]) | ExprCompose([(ExprInt32(0), 0, 32), (f[32:], 32, 64)]), f), ((ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) * ExprInt64(0x123))[32:64], - (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) * ExprInt64(0x123))[32:64]) + (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) * ExprInt64(0x123))[32:64]), + + (ExprInt32(0x12), + ExprInt32(0x12L)) ] |