about summary refs log tree commit diff stats
path: root/miasm2/arch/mep/arch.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /miasm2/arch/mep/arch.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'miasm2/arch/mep/arch.py')
-rw-r--r--miasm2/arch/mep/arch.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/miasm2/arch/mep/arch.py b/miasm2/arch/mep/arch.py
index e4d66a63..2266b596 100644
--- a/miasm2/arch/mep/arch.py
+++ b/miasm2/arch/mep/arch.py
@@ -1,6 +1,7 @@
 # Toshiba MeP-c4 - miasm architecture definition
 # Guillaume Valadon <guillaume@valadon.net>
 
+from builtins import range
 from miasm2.core.cpu import *
 from miasm2.core.utils import Disasm_Exception
 from miasm2.expression.expression import Expr, ExprId, ExprInt, ExprLoc, \
@@ -279,7 +280,7 @@ class instruction_mep(instruction):
         self.args[num] = ExprInt(off, 32)
 
 
-class mep_additional_info:
+class mep_additional_info(object):
     """Additional MeP instructions information
     """
 
@@ -432,7 +433,7 @@ class mn_mep(cls_mn):
         o = 0  # the returned value
         while n:
             # Get a byte, the offset is adjusted according to the endianness
-            offset = start / 8  # the offset in bytes
+            offset = start // 8  # the offset in bytes
             n_offset = cls.endian_offset(attrib, offset)  # the adjusted offset
             c = cls.getbytes(bitstream, n_offset, 1)
             if not c:
@@ -552,7 +553,7 @@ class mep_arg(m_arg):
                 return arg.name
             if isinstance(arg.name, str) and arg.name in gpr_names:
                 return None  # GV: why?
-            loc_key = loc_db.get_or_create_name_location(arg.name)
+            loc_key = loc_db.get_or_create_name_location(arg.name.encode())
             return ExprLoc(loc_key, 32)
 
         elif isinstance(arg, AstMem):