diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-10-09 17:47:00 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2021-06-08 08:11:01 +0200 |
| commit | 2a3c5a4f9db4d4d6e6cadbd5886218054efe6261 (patch) | |
| tree | 8d54a9b3e8a199d578aef71025d16c372c24f6b7 /miasm/core/parse_asm.py | |
| parent | 6285271a95f3ec9815728fb808a69bb21b50f770 (diff) | |
| download | focaccia-miasm-2a3c5a4f9db4d4d6e6cadbd5886218054efe6261.tar.gz focaccia-miasm-2a3c5a4f9db4d4d6e6cadbd5886218054efe6261.zip | |
Symbols are str instead of bytes
Diffstat (limited to 'miasm/core/parse_asm.py')
| -rw-r--r-- | miasm/core/parse_asm.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm/core/parse_asm.py b/miasm/core/parse_asm.py index 19bf4415..79ef416d 100644 --- a/miasm/core/parse_asm.py +++ b/miasm/core/parse_asm.py @@ -3,6 +3,7 @@ import re import codecs from builtins import range +from miasm.core.utils import force_str from miasm.expression.expression import ExprId, ExprInt, ExprOp, LocKey import miasm.core.asmblock as asmblock from miasm.core.cpu import instruction, base_expr @@ -67,7 +68,7 @@ STATE_IN_BLOC = 1 def asm_ast_to_expr_with_size(arg, loc_db, size): if isinstance(arg, AstId): - return ExprId(arg.name.encode(), size) + return ExprId(force_str(arg.name), size) if isinstance(arg, AstOp): args = [asm_ast_to_expr_with_size(tmp, loc_db, size) for tmp in arg.args] return ExprOp(arg.op, *args) @@ -174,7 +175,7 @@ def parse_txt(mnemo, attrib, txt, loc_db): # label match_re = LABEL_RE.match(line) if match_re: - label_name = match_re.group(1).encode() + label_name = match_re.group(1) label = loc_db.get_or_create_name_location(label_name) lines.append(label) continue |