Bug 46475

GemStone/S 64 Bit

3.3.1, 3.3, 3.2.15, 3.2.14, 3.2.13, 3.2.12, 3.2.11, 3.2.10, 3.2.x, 3.2, 3.1.15, 3.1.0.6, 3.1.0.5, 3.1.x, 3.0.x, 2.4.7, 2.4.6, 2.x

3.3.3, 3.2.16

changeClassTo: with fewer instance variables may have problems

When changeClassTo: is used to change an instance to a compatible type of class that has fewer instance variables than its current class, the handling of the surplus instance variables is not always correct.

Instances of IdentityBag become corrupt.

Instances of some kinds of collection shift the contents that were in named instance variables into the unnamed instance variables. For IdentitySet, the collection size remains the same, so the contents effectively gain values that were in the named instance variables and lose some of the previous contents.

Other collections, such as Set, are unaffected.

Non-collection classes also move the contents of the named instance variables into unnamed slots, however, since these classes are not indexable, these slots are inaccessible (except using _primitiveAt:).

See also bug 45956 on changeClassTo: behavior with respect to the handling of named and indexed instance variables.


Last updated: 11/7/16