diff options
| author | serpilliere <devnull@localhost> | 2012-06-01 16:40:03 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-06-01 16:40:03 +0200 |
| commit | 2ec2401129c315c45ea8c22f46b29f1f9ea69547 (patch) | |
| tree | b781cda06cef2a9074ad1638163ff101f3cfbfd2 /miasm/expression/expression_helper.py | |
| parent | a34a6e01e5ca1dafbdc539fcbf28d17df657ef77 (diff) | |
| download | focaccia-miasm-2ec2401129c315c45ea8c22f46b29f1f9ea69547.tar.gz focaccia-miasm-2ec2401129c315c45ea8c22f46b29f1f9ea69547.zip | |
expr: fix exprcompose bugs; ia32sem bug
Diffstat (limited to 'miasm/expression/expression_helper.py')
| -rw-r--r-- | miasm/expression/expression_helper.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/miasm/expression/expression_helper.py b/miasm/expression/expression_helper.py index 8cf422bb..37a2a273 100644 --- a/miasm/expression/expression_helper.py +++ b/miasm/expression/expression_helper.py @@ -40,7 +40,7 @@ def merge_sliceto_slice(args): sources_int = {} for a in args: if isinstance(a[0], ExprInt): - #sources_int[a.start] = a + # 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]] = (ExprInt(a[0].arg.__class__(a[0].arg)), @@ -54,13 +54,13 @@ def merge_sliceto_slice(args): non_slice[a[1]] = a - #find max stop to determine size + # find max stop to determine size max_size = None for a in args: if max_size == None or max_size < a[2]: max_size = a[2] - #first simplify all num slices + # first simplify all num slices final_sources = [] sorted_s = [] for x in sources_int.values(): @@ -72,7 +72,7 @@ def merge_sliceto_slice(args): while sorted_s: start, v = sorted_s.pop() - out = e.reload_expr() + out = v[0].reload_expr(), v[1], v[2] while sorted_s: if sorted_s[-1][1][2] != start: break @@ -510,7 +510,7 @@ def expr_simp_w(e): elif isinstance(arg, ExprInt): total_bit = e.stop-e.start - mask = uint64((uint64(1)<<(e.stop-e.start))-1) + mask = uint64((1<<(e.stop-e.start))-1) if total_bit in tab_size_int: return ExprInt(tab_size_int[total_bit]((uint64((arg.arg)>>e.start)) & mask)) else: |