about summary refs log tree commit diff stats
path: root/miasm2/core/sembuilder.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/core/sembuilder.py')
-rw-r--r--miasm2/core/sembuilder.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/miasm2/core/sembuilder.py b/miasm2/core/sembuilder.py
index 2bf8ba2c..b2cbb0ad 100644
--- a/miasm2/core/sembuilder.py
+++ b/miasm2/core/sembuilder.py
@@ -151,12 +151,13 @@ class SemBuilder(object):
 
                 if (isinstance(dst, ast.Name) and
                     dst.id not in argument_names and
-                    dst.id not in self._ctx):
+                    dst.id not in self._ctx and
+                    dst.id not in self._local_ctx):
 
                     # Real variable declaration
                     statement.value = src
                     real_body.append(statement)
-                    self._ctx[dst.id] = src
+                    self._local_ctx[dst.id] = src
                     continue
 
                 dst.ctx = ast.Load()
@@ -266,6 +267,9 @@ class SemBuilder(object):
         fc_ast = parsed.body[0]
         argument_names = [name.id for name in fc_ast.args.args]
 
+        # Init local cache
+        self._local_ctx = {}
+
         # Translate (blocks[0][0] is the current instr)
         blocks, body = self._parse_body(fc_ast.body, argument_names)