about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2019-11-18 11:13:44 +0100
committerGitHub <noreply@github.com>2019-11-18 11:13:44 +0100
commitcc565ff0c1875793ac153eb6f163d88c0dcab3de (patch)
tree1de9301afd636128f53c9d1d3b19ea35410d3967
parent837b13c7c7f647030c74b08e5cb552b87c157f76 (diff)
parent39d7e4f1daad19a50f60256e6e753628e1db205b (diff)
downloadmiasm-cc565ff0c1875793ac153eb6f163d88c0dcab3de.tar.gz
miasm-cc565ff0c1875793ac153eb6f163d88c0dcab3de.zip
Merge pull request #1093 from htfy96/fix-ast
sembuilder: more compatible way to construct AST module
-rw-r--r--miasm/core/sembuilder.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/miasm/core/sembuilder.py b/miasm/core/sembuilder.py
index c51ce608..efd80ce4 100644
--- a/miasm/core/sembuilder.py
+++ b/miasm/core/sembuilder.py
@@ -336,10 +336,11 @@ class SemBuilder(object):
                                                               ctx=ast.Load())],
                                                ctx=ast.Load())))
 
-        ret = ast.Module([ast.FunctionDef(name=fc_ast.name,
-                                          args=fc_ast.args,
-                                          body=body,
-                                          decorator_list=[])])
+        ret = ast.parse('')
+        ret.body = [ast.FunctionDef(name=fc_ast.name,
+                                    args=fc_ast.args,
+                                    body=body,
+                                    decorator_list=[])]
 
         # To display the generated function, use codegen.to_source
         # codegen: https://github.com/andreif/codegen