diff options
| -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)) ] |