Potential bug in becomeForward:, NEED HELP!

Bob Arning arning at charm.net
Fri May 17 03:24:48 UTC 2002


On Thu, 16 May 2002 09:30:40 -0700 (PDT) Chris Muller <afunkyobject at yahoo.com> wrote:
>If you define a class called MyTestClass, then, in a workspace:
>
>  String new becomeForward: #MyTestClass.
>  Smalltalk includesKey: #MyTestClass
>
>returns false.  The entire class appears removed from the system, at least
>somewhat.
>
>Is this a bug?  If so, what is the solution as this is causing me some grief.

Sure looks like one. What's happening is that the pointer to String new is replaced with a pointer to #MyTestClass as you would expect, but the hash value is copied from the old String new header to the #MyTestClass header and this is the reverse of what is needed. This causes the dictionary lookup in Smalltalk to fail, mostly.

The solution would be a new VM or avoid mutating objects whose hash values have already been captured somewhere (and that means any Symbol, fwiw).

Cheers,
Bob



More information about the Squeak-dev mailing list