Commit 43c1cb2e authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.28.x'

parents 4f4841aa 93c7400a
......@@ -39,6 +39,17 @@ Other changes
-------------
0.28.4 (2018-??-??)
===================
Bugs fixed
----------
* Reallowing ``tp_clear()`` in a subtype of an ``@no_gc_clear`` extension type
generated an invalid C function call to the (non-existent) base type implementation.
(Github issue #2309)
0.28.3 (2018-05-27)
===================
......
......@@ -1606,7 +1606,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("}")
def generate_clear_function(self, scope, code, cclass_entry):
tp_slot = TypeSlots.GCDependentSlot("tp_clear")
tp_slot = TypeSlots.get_slot_by_name("tp_clear")
slot_func = scope.mangle_internal("tp_clear")
base_type = scope.parent_type.base_type
if tp_slot.slot_code(scope) != slot_func:
......
......@@ -56,6 +56,21 @@ cdef class DisableTpClear:
pto.tp_clear(self)
cdef class ReallowTpClear(DisableTpClear):
"""
>>> import gc
>>> obj = ReallowTpClear()
>>> is_tp_clear_null(obj)
False
>>> obj.attr = obj # create hard reference cycle
>>> del obj; _ignore = gc.collect()
# Problem: cannot really validate that the cycle was cleaned up without using weakrefs etc...
"""
cdef public object attr
def test_closure_without_clear(str x):
"""
>>> c = test_closure_without_clear('abc')
......
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