From 31e0f5b59eee47e41bacb558caf3733e7a4bbb32 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 30 Apr 2009 17:53:55 +0200 Subject: [PATCH] copy function arguments into closure also when no conversion is needed --- Cython/Compiler/Nodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. -- 2.26.2