diff options
| author | ajax <devnull@localhost> | 2014-06-12 18:40:55 +0200 |
|---|---|---|
| committer | ajax <devnull@localhost> | 2014-06-12 18:40:55 +0200 |
| commit | 0698cd3820a70182c362ba113849fe8ca5e0e032 (patch) | |
| tree | 5fd0cabf8bc3cb43a706b401906e2c49bdf127b1 /test/expression/simplifications.py | |
| parent | 8462e1b5b65b61e837e673229e1bae4dc78c7840 (diff) | |
| download | focaccia-miasm-0698cd3820a70182c362ba113849fe8ca5e0e032.tar.gz focaccia-miasm-0698cd3820a70182c362ba113849fe8ca5e0e032.zip | |
Simplifications_cond: Fix size issue, add constructor
I could have use a child class of ExprOp specific for conditions, but I prefer to keep a better modularity by just using "<s", "<u" as a new op I don't add the size issue in expression/expression.py (such as 'parity') because we don't want dependencies from this file to expression/simplifications_cond (for TOK_*)
Diffstat (limited to 'test/expression/simplifications.py')
| -rw-r--r-- | test/expression/simplifications.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index 9a4fbe8c..057ff1c7 100644 --- a/test/expression/simplifications.py +++ b/test/expression/simplifications.py @@ -4,7 +4,7 @@ from pdb import pm from miasm2.expression.expression import * from miasm2.expression.simplifications import expr_simp, ExpressionSimplifier -from miasm2.expression.simplifications_cond import TOK_INF_SIGNED, TOK_INF_UNSIGNED +from miasm2.expression.simplifications_cond import ExprOp_inf_signed, ExprOp_inf_unsigned # Define example objects a = ExprId('a') @@ -178,11 +178,11 @@ for e, e_check in to_test[:]: to_test = [ (((a - b) ^ ((a ^ b) & ((a - b) ^ a))).msb(), - ExprOp(TOK_INF_SIGNED, a, b)), + ExprOp_inf_signed(a, b)), ((((a - b) ^ ((a ^ b) & ((a - b) ^ a))) ^ a ^ b).msb(), - ExprOp(TOK_INF_UNSIGNED, a, b)), - (ExprOp(TOK_INF_UNSIGNED, ExprInt32(-1), ExprInt32(3)), ExprInt1(0)), - (ExprOp(TOK_INF_SIGNED, ExprInt32(-1), ExprInt32(3)), ExprInt1(1)), + ExprOp_inf_unsigned(a, b)), + (ExprOp_inf_unsigned(ExprInt32(-1), ExprInt32(3)), ExprInt1(0)), + (ExprOp_inf_signed(ExprInt32(-1), ExprInt32(3)), ExprInt1(1)), ] expr_simp_cond = ExpressionSimplifier() |