Browse Source

Print jitted function definitions before exec'ing them

jonathanvdc 8 years ago
parent
commit
f125820f06
1 changed files with 3 additions and 3 deletions
  1. 3 3
      kernel/modelverse_jit/jit.py

+ 3 - 3
kernel/modelverse_jit/jit.py

@@ -480,12 +480,12 @@ class ModelverseJit(object):
         # The comment below makes pylint shut up about our (hopefully benign) use of exec here.
         # pylint: disable=I0011,W0122
 
-        # Convert the function definition to Python code, and compile it.
-        exec(str(function_def), self.jit_globals)
-
         if self.jit_code_log_function is not None:
             self.jit_code_log_function(function_def)
 
+        # Convert the function definition to Python code, and compile it.
+        exec(str(function_def), self.jit_globals)
+
         # Extract the compiled function from the JIT global state.
         return self.jit_globals[function_name]