Commit 84b6aae6 authored by gsamain's avatar gsamain

Fix cypclass refcount on arrays

parent 4a10a97c
......@@ -4169,6 +4169,13 @@ class IndexNode(_IndexingBaseNode):
code.putln(
"%s = %s;" % (self.result(), rhs.result()))
if self.type.is_cyp_class:
# This hack is due to the fact cypclass objects are ref-counted, so
# they goes into temps, but their assignment code is a simple C assignment,
# which doesn't incref the temp.
# So we are effectively absorbing a reference in this case.
rhs.generate_post_assignment_code(code)
else:
self.generate_subexpr_disposal_code(code)
self.free_subexpr_temps(code)
rhs.generate_disposal_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