Staging
v0.5.1
Revision ebc6a65f935df1070ebc06efc0277adc3e0fe742 authored by Guido van Rossum on 11 October 2002, 00:22:22 UTC, committed by Guido van Rossum on 11 October 2002, 00:22:22 UTC
In inherit_slots(), get rid of the COPYSLOT(tp_dictoffset).  Copying
the offset from a non-dominant base makes no sense: either the
non-dominant base has a nonzero tp_dictoffset, and then we should have
already copied it from the dominant base (at the very end of
inherit_special()), or the non-dominant base has no tp_dictoffset and
for some reason type_new() decided not to add one.  The tp_dictoffset
from a non-dominant base is likely to conflict with the instance
layout of the dominant base, so copying the tp_dictoffset from the
non-dominant base would be a really bad idea in that case.  This bug
can only be triggered by multiple inheritance from an extension class
that doesn't set tp_dictoffset and a new-style user-level class that
does have one.  There are no such extension classes in the
distribution, but there are 3rd party ones.  (Zope3 now has one,
that's how I found this. :-)

I've asked a few heavy users of new-style classes, extension classes
and metaclasses (David Abrahams and Kevin Jacobs), and neither of them
found any problems in their test suite after applying this fix, so I
assume it's safe.
1 parent a1eb227
History
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
.cvsignore -rw-r--r-- 109 bytes
.hgtags -rw-r--r-- 2.3 KB
LICENSE -rw-r--r-- 12.3 KB
Makefile.pre.in -rw-r--r-- 25.9 KB
PLAN.txt -rw-r--r-- 14.1 KB
README -rw-r--r-- 41.7 KB
acconfig.h -rw-r--r-- 7.5 KB
configure -rwxr-xr-x 210.1 KB
configure.in -rw-r--r-- 55.6 KB
install-sh -rwxr-xr-x 5.5 KB
pyconfig.h.in -rw-r--r-- 19.6 KB
setup.py -rw-r--r-- 34.5 KB

README

back to top