[Vm-dev] to:do: mis-translated...

Eliot Miranda eliot.miranda at gmail.com
Fri Mar 29 23:13:04 UTC 2013


Hi All,

    I just noticed that to:do: is mis-translated.  e.g.

nilFieldsOf: arrayObj
0 to: (self lengthOf: arrayObj) - 1 do:
[:i|
self storePointerUnchecked: i ofObject: arrayObj withValue: nilObj]

=>
            /* begin nilFieldsOf: */
            for (i1 = 0; i1 <= ((lengthOf(stack)) - 1); i1 += 1) {
                longAtput((stack + BaseHeaderSize) + (i1 << ShiftForWord),
GIV(nilObj));
            }

where-as of course it should be translated as e.g.

            int iLimit;
...
            /* begin nilFieldsOf: */
            iLimit = (lengthOf(stack)) - 1;
            for (i1 = 0; i1 <= iLimit; i1 += 1) {
                longAtput((stack + BaseHeaderSize) + (i1 << ShiftForWord),
GIV(nilObj));
            }

I'll try and fix this but I thought I'd raise it because it could cause
serious bugs.
-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20130329/0a634f27/attachment.htm


More information about the Vm-dev mailing list