diff options
| author | Camille Mougey <commial@gmail.com> | 2018-06-22 10:28:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-22 10:28:38 +0200 |
| commit | 9f040a7013f471ecb96c5f64e5ab3f139d1a09c7 (patch) | |
| tree | f4f21334788d6c153ce08cead01e614349cdf700 /miasm2/core/parse_asm.py | |
| parent | 1c64ca68ff3ad2985d2c89b4b8a8e13ec282c0e1 (diff) | |
| parent | 189d72985236b0b35586669e7d9309951ffdccb6 (diff) | |
| download | miasm-9f040a7013f471ecb96c5f64e5ab3f139d1a09c7.tar.gz miasm-9f040a7013f471ecb96c5f64e5ab3f139d1a09c7.zip | |
Merge branch 'master' into patch-2
Diffstat (limited to 'miasm2/core/parse_asm.py')
| -rw-r--r-- | miasm2/core/parse_asm.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/miasm2/core/parse_asm.py b/miasm2/core/parse_asm.py index 86871c37..3b97cbb6 100644 --- a/miasm2/core/parse_asm.py +++ b/miasm2/core/parse_asm.py @@ -73,30 +73,6 @@ def guess_next_new_label(symbol_pool): i += 1 -def replace_expr_labels(expr, symbol_pool, replace_id): - """Create LocKey of the expression @expr in the @symbol_pool - Update @replace_id""" - - if not expr.is_loc(): - return expr - - old_name = symbol_pool.loc_key_to_name(expr.loc_key) - new_lbl = symbol_pool.getby_name_create(old_name) - replace_id[expr] = ExprLoc(new_lbl, expr.size) - return replace_id[expr] - - -def replace_orphan_labels(instr, symbol_pool): - """Link orphan labels used by @instr to the @symbol_pool""" - - for i, arg in enumerate(instr.args): - replace_id = {} - arg.visit(lambda e: replace_expr_labels(e, - symbol_pool, - replace_id)) - instr.args[i] = instr.args[i].replace_expr(replace_id) - - STATE_NO_BLOC = 0 STATE_IN_BLOC = 1 @@ -224,8 +200,6 @@ def parse_txt(mnemo, attrib, txt, symbol_pool=None): line = line.strip(' ').strip('\t') instr = mnemo.fromstring(line, symbol_pool, attrib) - replace_orphan_labels(instr, symbol_pool) - if instr.dstflow(): instr.dstflow2label(symbol_pool) lines.append(instr) |