Skip to content

Commit

Permalink
Merge pull request #1502 from W0ni/fix_expression_division
Browse files Browse the repository at this point in the history
fix expression division
  • Loading branch information
serpilliere authored Aug 20, 2024
2 parents c8aafe1 + 0dfc550 commit 7ffe286
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miasm/expression/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,11 @@ def __add__(self, other):
def __sub__(self, other):
return ExprOp('+', self, ExprOp('-', other))

def __div__(self, other):
def __truediv__(self, other):
return ExprOp('/', self, other)

def __floordiv__(self, other):
return self.__div__(other)
return self.__truediv__(other)

def __mod__(self, other):
return ExprOp('%', self, other)
Expand Down
6 changes: 6 additions & 0 deletions test/expression/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,22 @@

C = A+B
D = C + A
E = A / B
F = A // B
assert E is F

assert A in A
assert A in C
assert B in C
assert C in C
assert E in E

assert A in D
assert B in D
assert C in D
assert D in D
assert A in E
assert B in E

assert C not in A
assert C not in B
Expand Down

0 comments on commit 7ffe286

Please sign in to comment.