Bug 45956

GemStone/S 64 Bit

3.3.9, 3.3.8, 3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.3, 3.3.1, 3.3, 3.2.16, 3.2.15, 3.2.14, 3.2.x,,, 3.1.x, 3.0.x, 2.4.8,,,, 2.x, earlier versions


changeClassTo: problematic behavior when target class has different size

changeClassTo: can be used to change the class of an object, between indexable and non-indexable classes (that is, between a class that allows or does not allow unnamed instance variables, to the converse), and to a class that has more or fewer named instance variables.

The behavior for on some of these changes was not correct with regards to overflow instance variable values, particularly between indexed and named instance variable slots.

When converting from an instance with indexable instance variables to a class that was not indexable, if there are more named instance variables in the target class, these slots were filled with nils, and the indexed contents were left in place.  The resulting object was larger by that difference.

See also bug 46475 on changeClassTo: behavior, in which some kinds of collections may be corrupted/data lost.


Last updated: 4/3/17