Browse Source

Fix a bug in bytecode-to-tree tranformation

jonathanvdc 8 years ago
parent
commit
19172aae71
1 changed files with 1 additions and 2 deletions
  1. 1 2
      kernel/modelverse_jit/bytecode_to_tree.py

+ 1 - 2
kernel/modelverse_jit/bytecode_to_tree.py

@@ -504,8 +504,6 @@ class AnalysisState(object):
 
     def analyze_direct_call(self, callee_id, callee_name, argument_list):
         """Tries to analyze a direct 'call' instruction."""
-        self.register_function_var(callee_id)
-
         body_id, = yield [("RD", [callee_id, jit_runtime.FUNCTION_BODY_KEY])]
 
         # Make this function dependent on the callee.
@@ -587,6 +585,7 @@ class AnalysisState(object):
         if isinstance(target, bytecode_ir.AccessInstruction):
             # 'access(resolve(var))' instructions are translated to direct calls.
             if isinstance(target.pointer, bytecode_ir.ResolveInstruction):
+                self.register_function_var(target.pointer.variable.node_id)
                 resolved_var_name = target.pointer.variable.name
 
                 # Try to look up the name as a global.