Commit 141b62e6 authored by Stefan Behnel's avatar Stefan Behnel

fix temp allocation when importing external C functions

parent 12b7cf76
...@@ -37,7 +37,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -37,7 +37,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# body StatListNode # body StatListNode
# #
# referenced_modules [ModuleScope] # referenced_modules [ModuleScope]
# module_temp_cname string
# full_module_name string # full_module_name string
# #
# scope The module scope. # scope The module scope.
...@@ -63,9 +62,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -63,9 +62,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
env.return_type = PyrexTypes.c_void_type env.return_type = PyrexTypes.c_void_type
self.referenced_modules = [] self.referenced_modules = []
self.find_referenced_modules(env, self.referenced_modules, {}) self.find_referenced_modules(env, self.referenced_modules, {})
if self.has_imported_c_functions():
self.module_temp_cname = env.allocate_temp_pyobject()
env.release_temp(self.module_temp_cname)
if options.recursive: if options.recursive:
self.generate_dep_file(env, result) self.generate_dep_file(env, result)
self.generate_c_code(env, options, result) self.generate_c_code(env, options, result)
...@@ -1831,7 +1827,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1831,7 +1827,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if entries: if entries:
env.use_utility_code(import_module_utility_code) env.use_utility_code(import_module_utility_code)
env.use_utility_code(function_import_utility_code) env.use_utility_code(function_import_utility_code)
temp = self.module_temp_cname temp = code.globalstate.allocate_temp(py_object_type)
code.putln( code.putln(
'%s = __Pyx_ImportModule("%s"); if (!%s) %s' % ( '%s = __Pyx_ImportModule("%s"); if (!%s) %s' % (
temp, temp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment