Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.679.mcz
==================== Summary ====================
Name: Kernel-eem.679 Author: eem Time: 18 April 2012, 10:40:18.574 am UUID: aa8e1b1a-a108-4228-91bf-c996fa4b5b26 Ancestors: Kernel-eem.678
Fix loading of CompiledMethod subclasses. The old code just used CompiledMethod's format, which includes its compact class index, hence resulting in instantiating the subclass returning an instance of CompiledMethod. The new code masks out CompiledMethod's compact class imdex (if any) and masks in the right compact class index.
=============== Diff against Kernel-eem.678 ===============
Item was changed: ----- Method: ClassBuilder>>computeFormat:instSize:forSuper:ccIndex: (in category 'class format') ----- computeFormat: type instSize: newInstSize forSuper: newSuper ccIndex: ccIndex "Compute the new format for making oldClass a subclass of newSuper. Return the format or nil if there is any problem." | instSize isVar isWords isPointers isWeak | + type == #compiledMethod ifTrue: + [^(CompiledMethod format + bitClear: (16r1F bitShift: 11)) + bitOr: (ccIndex bitShift: 11)]. - type == #compiledMethod - ifTrue:[^CompiledMethod format]. instSize := newInstSize + (newSuper ifNil:[0] ifNotNil:[newSuper instSize]). + instSize > 254 ifTrue: + [self error: 'Class has too many instance variables (', instSize printString,')'. - instSize > 254 ifTrue:[ - self error: 'Class has too many instance variables (', instSize printString,')'. ^nil]. type == #normal ifTrue:[isVar := isWeak := false. isWords := isPointers := true]. type == #bytes ifTrue:[isVar := true. isWords := isPointers := isWeak := false]. type == #words ifTrue:[isVar := isWords := true. isPointers := isWeak := false]. type == #variable ifTrue:[isVar := isPointers := isWords := true. isWeak := false]. type == #weak ifTrue:[isVar := isWeak := isWords := isPointers := true]. + (isPointers not and:[instSize > 0]) ifTrue: + [self error:'A non-pointer class cannot have instance variables'. - (isPointers not and:[instSize > 0]) ifTrue:[ - self error:'A non-pointer class cannot have instance variables'. ^nil]. ^(self format: instSize variable: isVar words: isWords pointers: isPointers weak: isWeak) + (ccIndex bitShift: 11).!
squeak-dev@lists.squeakfoundation.org