From: Stefan Behnel Date: Thu, 30 Apr 2009 15:53:55 +0000 (+0200) Subject: copy function arguments into closure also when no conversion is needed X-Git-Tag: 0.13.beta0~2^2~146 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=31e0f5b59eee47e41bacb558caf3733e7a4bbb32;p=cython.git copy function arguments into closure also when no conversion is needed --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index a3f1adb1..0f784d81 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2332,11 +2332,14 @@ class DefNode(FuncDefNode): code.putln('}') def generate_argument_conversion_code(self, code): - # Generate code to convert arguments from - # signature type to declared type, if needed. + # Generate code to convert arguments from signature type to + # declared type, if needed. Also copies signature arguments + # into closure fields. for arg in self.args: if arg.needs_conversion: self.generate_arg_conversion(arg, code) + elif arg.entry.in_closure: + code.putln('%s = %s;' % (arg.entry.cname, arg.hdr_cname)) def generate_arg_conversion(self, arg, code): # Generate conversion code for one argument.