[Vm-dev] become: bug

Florin Mateoc florin.mateoc at gmail.com
Sat Jan 30 21:58:28 UTC 2016


Hi all,

Perhaps this is a known bug, since apparently it's been there forever, but now that we have a shiny new vm, it might be
the right time to fix it.
If we do:

    | a b |

    a := Array new: 1.
    a at: 1 put: (Array with: a).

At this point, as expected, evaluating

    a first first == a

returns true.
But if we then do:

    b := Object new.
    a become: b.

then

    ((b at: 1) at: 1) == b

returns false.
Instead

    ((b at: 1) at: 1) == a

returns true.

This obvious bug happens in all the VMs (I tried with Squeak 2.8 and 5)

Florin

P.S. Wow, I just tried this in VA and in VW.
In VA it works correctly (except it has to be "b become: a" since VA has one-way become:), but the same bug exists in VW
(I tried with 2.5 and 7.3)


More information about the Vm-dev mailing list