diff options
| author | Camille Mougey <commial@gmail.com> | 2018-06-20 18:12:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-20 18:12:32 +0200 |
| commit | 240902b3b64cfb4ceb9ff80861ec99b1e899c1a1 (patch) | |
| tree | f06898d48b4a704d72c68eb390490a9a316f1ac2 | |
| parent | 4c33cf22260fc2bc870de9f474e9043ddc1d6019 (diff) | |
| parent | 0cdff3ee419c0c8ecc87f13bcf682953172d0c0a (diff) | |
| download | miasm-240902b3b64cfb4ceb9ff80861ec99b1e899c1a1.tar.gz miasm-240902b3b64cfb4ceb9ff80861ec99b1e899c1a1.zip | |
Merge pull request #778 from serpilliere/fix_parse_asm
Parse_asm: remove useless functions
| -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) |