diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 10:35:32 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 13:37:03 +0100 |
| commit | c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e (patch) | |
| tree | eae7ae526c7e45d1e640c814ec3a03d5b999fac8 /miasm2/expression/expression_helper.py | |
| parent | e37d545e07a22b0ea9a5ce21b975c73927dd4d50 (diff) | |
| download | miasm-c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e.tar.gz miasm-c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e.zip | |
Expression: fix api
Diffstat (limited to 'miasm2/expression/expression_helper.py')
| -rw-r--r-- | miasm2/expression/expression_helper.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/miasm2/expression/expression_helper.py b/miasm2/expression/expression_helper.py index 196ad5cd..ece720e0 100644 --- a/miasm2/expression/expression_helper.py +++ b/miasm2/expression/expression_helper.py @@ -43,9 +43,8 @@ def merge_sliceto_slice(args): # sources_int[a.start] = a # copy ExprInt because we will inplace modify arg just below # /!\ TODO XXX never ever modify inplace args... - sources_int[a[1]] = (m2_expr.ExprInt_fromsize(a[2] - a[1], - a[0].arg.__class__( - a[0].arg)), + sources_int[a[1]] = (m2_expr.ExprInt(int(a[0].arg), + a[2] - a[1]), a[1], a[2]) elif isinstance(a[0], m2_expr.ExprSlice): @@ -86,7 +85,7 @@ def merge_sliceto_slice(args): out[0] = m2_expr.ExprInt(a) sorted_s.pop() out[1] = s_start - out[0] = m2_expr.ExprInt_fromsize(size, out[0].arg) + out[0] = m2_expr.ExprInt(int(out[0].arg), size) final_sources.append((start, out)) final_sources_int = final_sources @@ -409,7 +408,7 @@ class ExprRandom(object): @size: (optional) number max bits """ num = random.randint(0, cls.number_max % (2**size)) - return m2_expr.ExprInt_fromsize(size, num) + return m2_expr.ExprInt(num, size) @classmethod def atomic(cls, size=32): |