about summary refs log tree commit diff stats
path: root/miasm2/core/sembuilder.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-03-29 17:01:07 +0200
committerAjax <commial@gmail.com>2017-03-30 16:04:40 +0200
commite8916cf8cc44a0cc375af762b38798cb378b986c (patch)
tree6c281f7fc4efd326fb95151173b7847026a94f05 /miasm2/core/sembuilder.py
parentf81c3e4b42d0ce487101b8e0802e43b32b261b1d (diff)
downloadmiasm-e8916cf8cc44a0cc375af762b38798cb378b986c.tar.gz
miasm-e8916cf8cc44a0cc375af762b38798cb378b986c.zip
Use non-deprecated ExprInt form in sembuilder
Diffstat (limited to 'miasm2/core/sembuilder.py')
-rw-r--r--miasm2/core/sembuilder.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/miasm2/core/sembuilder.py b/miasm2/core/sembuilder.py
index f101d94c..138e4552 100644
--- a/miasm2/core/sembuilder.py
+++ b/miasm2/core/sembuilder.py
@@ -32,7 +32,7 @@ class MiasmTransformer(ast.NodeTransformer):
         node = self.generic_visit(node)
 
         if isinstance(node.func, ast.Name):
-            # iX(Y) -> ExprIntX(Y)
+            # iX(Y) -> ExprInt(Y, X)
             fc_name = node.func.id
 
             # Match the function name
@@ -41,10 +41,11 @@ class MiasmTransformer(ast.NodeTransformer):
 
             # Do replacement
             if integer is not None:
-                new_name = "ExprInt%s" % integer.groups()[0]
-
-            # Replace in the node
-            node.func.id = new_name
+                size = int(integer.groups()[0])
+                new_name = "ExprInt"
+                # Replace in the node
+                node.func.id = new_name
+                node.args.append(ast.Num(n=size))
 
         elif (isinstance(node.func, ast.Str) or
               (isinstance(node.func, ast.BinOp) and