Commit 84b6aae6 authored by gsamain's avatar gsamain

Fix cypclass refcount on arrays

parent 4a10a97c
...@@ -4169,9 +4169,16 @@ class IndexNode(_IndexingBaseNode): ...@@ -4169,9 +4169,16 @@ class IndexNode(_IndexingBaseNode):
code.putln( code.putln(
"%s = %s;" % (self.result(), rhs.result())) "%s = %s;" % (self.result(), rhs.result()))
self.generate_subexpr_disposal_code(code) if self.type.is_cyp_class:
self.free_subexpr_temps(code) # This hack is due to the fact cypclass objects are ref-counted, so
rhs.generate_disposal_code(code) # 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)
rhs.free_temps(code) rhs.free_temps(code)
def _check_byte_value(self, code, rhs): def _check_byte_value(self, code, rhs):
......
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