Commit 736bb2e3 authored by Stefan Behnel's avatar Stefan Behnel

do it right this time: call generate_post_assignment_code

parent 52d9fdb8
...@@ -1234,17 +1234,13 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1234,17 +1234,13 @@ class FuncDefNode(StatNode, BlockNode):
if not default.is_literal: if not default.is_literal:
default.generate_evaluation_code(code) default.generate_evaluation_code(code)
default.make_owned_reference(code) default.make_owned_reference(code)
if default.is_temp and default.type.is_pyobject:
cleanup = " %s = 0;" % default.result()
else:
cleanup = ''
code.putln( code.putln(
"%s = %s;%s" % ( "%s = %s;" % (
arg.default_entry.cname, arg.default_entry.cname,
default.result_as(arg.default_entry.type), default.result_as(arg.default_entry.type)))
cleanup)) default.generate_post_assignment_code(code)
code.put_giveref(arg.default_entry.cname)
default.free_temps(code) default.free_temps(code)
code.put_giveref(arg.default_entry.cname)
# For Python class methods, create and store function object # For Python class methods, create and store function object
if self.assmt: if self.assmt:
self.assmt.generate_execution_code(code) self.assmt.generate_execution_code(code)
......
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