Commit 123f1c85 authored by Stefan Behnel's avatar Stefan Behnel

fix reference leak in yield-from evaluation code

parent 0956b0be
...@@ -6589,13 +6589,11 @@ class YieldFromExprNode(YieldExprNode): ...@@ -6589,13 +6589,11 @@ class YieldFromExprNode(YieldExprNode):
code.globalstate.use_utility_code(UtilityCode.load_cached("YieldFrom", "Generator.c")) code.globalstate.use_utility_code(UtilityCode.load_cached("YieldFrom", "Generator.c"))
self.arg.generate_evaluation_code(code) self.arg.generate_evaluation_code(code)
self.arg.make_owned_reference(code)
code.put_xgiveref(self.arg.result())
code.putln("%s = __Pyx_Generator_Yield_From(%s, %s);" % ( code.putln("%s = __Pyx_Generator_Yield_From(%s, %s);" % (
Naming.retval_cname, Naming.retval_cname,
Naming.generator_cname, Naming.generator_cname,
self.arg.result_as(py_object_type))) self.arg.result_as(py_object_type)))
self.arg.generate_post_assignment_code(code) # reference was stolen self.arg.generate_disposal_code(code)
self.arg.free_temps(code) self.arg.free_temps(code)
code.put_xgotref(Naming.retval_cname) code.put_xgotref(Naming.retval_cname)
......
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