about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2019-05-27 10:37:43 +0200
committerGitHub <noreply@github.com>2019-05-27 10:37:43 +0200
commitab673c1c26d2ab63890ed9ee2777faa778df7b64 (patch)
tree936f7e450261ff877c1c6d16609976d12a8c6a19
parent4adc8f10a5561d9d2bd460e6595bec04e11d332c (diff)
parent1d53188ecdf204e12c3877693904193da09989b4 (diff)
downloadmiasm-ab673c1c26d2ab63890ed9ee2777faa778df7b64.tar.gz
miasm-ab673c1c26d2ab63890ed9ee2777faa778df7b64.zip
Merge pull request #1045 from serpilliere/cmp_expr_p3
Expression: add p3 ordering
-rw-r--r--miasm/expression/expression.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/miasm/expression/expression.py b/miasm/expression/expression.py
index 6c54b9a2..6f171d93 100644
--- a/miasm/expression/expression.py
+++ b/miasm/expression/expression.py
@@ -279,6 +279,11 @@ class Expr(object):
     def __ne__(self, other):
         return not self.__eq__(other)
 
+    def __lt__(self, other):
+        weight1 = EXPR_ORDER_DICT[self.__class__]
+        weight2 = EXPR_ORDER_DICT[other.__class__]
+        return weight1 < weight2
+
     def __add__(self, other):
         return ExprOp('+', self, other)