diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-05-27 08:09:03 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-05-27 08:09:03 +0200 |
| commit | 1d53188ecdf204e12c3877693904193da09989b4 (patch) | |
| tree | 6a544097ef53472c0f614afddc1dd9c12c8c6a70 /miasm/expression/expression.py | |
| parent | 142fb3411317e6ce63e9c3f9154530d9e65c9664 (diff) | |
| download | focaccia-miasm-1d53188ecdf204e12c3877693904193da09989b4.tar.gz focaccia-miasm-1d53188ecdf204e12c3877693904193da09989b4.zip | |
Expression: add p3 ordering
Diffstat (limited to 'miasm/expression/expression.py')
| -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) |