Message24845
Logged In: YES
user_id=4771
The objection to the proposed fix is not valid in light
of the bug #1303614, which gives a general way to abuse
subclassing to allow the __dict__ of an instance to be
assigned to and deleted, even when it should not be allowed. So I wouldn't worry too much about the case I pointed up, because it should be fixed together with #1303614 (though I don't really know how). For now I would be happy with just checking that subclassing a non-heap type doesn't move the dict within the structure.
The same remark probably applies to the weakref field. Both cases could be fixed by being more careful in typeobject.c:extra_ivars(): PyModule_Type should be considered to have extra_ivars() when compared to PyBaseObject_Type. This could be achieved by skipping the "t_size -= ..." part if "type" is not a heap type. Indeed, for non-heap types we should not try to consider that an extra dict or weakref slot is not important, because the C code probably accesses this extra slot directly, as in the case of moduleobject.c. |
|
Date |
User |
Action |
Args |
2007-08-23 14:30:39 | admin | link | issue1174712 messages |
2007-08-23 14:30:39 | admin | create | |
|