Forgot to run tests after last patch. (Oops.)
authorCraig Citro <craigcitro@gmail.com>
Mon, 5 Oct 2009 23:49:59 +0000 (16:49 -0700)
committerCraig Citro <craigcitro@gmail.com>
Mon, 5 Oct 2009 23:49:59 +0000 (16:49 -0700)
Cython/Compiler/Nodes.py
tests/run/closures_T82.pyx

index 5b4c8b5d45ca12addad87ca4953f1afe2eeb7fb2..183a6faf1874fac104c8592b8dc6bfd8021441f4 100644 (file)
@@ -1193,6 +1193,7 @@ class FuncDefNode(StatNode, BlockNode):
                 src = lenv.control_flow.get_state((entry.name, 'source'))
                 if entry.in_closure and src == 'arg':
                     code.put_var_incref(entry)
+                    code.put_var_giveref(entry)
                 elif not entry.in_closure and src != 'arg':
                     code.put_var_decref(entry)
                 
index 12fc510864e70997e2b48ea87287bf7c3961adc2..37f39532ce3183bc238d392c1549ff8aea2a5956 100644 (file)
@@ -5,7 +5,7 @@ __doc__ = u"""
 
 >>> f = add_n(1000000)
 >>> f(1000000), f(-1000000)
-2000000, 0
+(2000000, 0)
 
 >>> a(5)()
 8