preparing a function default argument needs a GIVEREF
authorStefan Behnel <scoder@users.berlios.de>
Sun, 22 Feb 2009 12:11:03 +0000 (13:11 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 22 Feb 2009 12:11:03 +0000 (13:11 +0100)
Cython/Compiler/Nodes.py

index 629270dc35358803ff80c2ac1f81a63b1b8d6602..01eb070afdef7ee165075e8f5fa5f842bfbd3c58 100644 (file)
@@ -1240,6 +1240,7 @@ class FuncDefNode(StatNode, BlockNode):
                         code.putln(
                             "%s = 0;" %
                                 default.result())
+                    code.put_giveref(arg.default_entry.cname)
                     default.free_temps(code)
         # For Python class methods, create and store function object
         if self.assmt: