diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-20 17:33:01 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-20 17:33:01 +0200 |
| commit | 0cdff3ee419c0c8ecc87f13bcf682953172d0c0a (patch) | |
| tree | 5b23dbdcab9bb0089db7337aaddb6584e266a0b8 /miasm2/core/parse_asm.py | |
| parent | 0adddb12a7410c4bbdd6ee79252e9bf05ca22818 (diff) | |
| download | miasm-0cdff3ee419c0c8ecc87f13bcf682953172d0c0a.tar.gz miasm-0cdff3ee419c0c8ecc87f13bcf682953172d0c0a.zip | |
Parse_asm: remove useless functions
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) |