diff options
| author | Camille Mougey <commial@gmail.com> | 2019-05-27 10:37:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-27 10:37:43 +0200 |
| commit | ab673c1c26d2ab63890ed9ee2777faa778df7b64 (patch) | |
| tree | 936f7e450261ff877c1c6d16609976d12a8c6a19 | |
| parent | 4adc8f10a5561d9d2bd460e6595bec04e11d332c (diff) | |
| parent | 1d53188ecdf204e12c3877693904193da09989b4 (diff) | |
| download | miasm-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.py | 5 |
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) |