[Vm-dev] suspect test in dabusiness.h

Eliot Miranda eliot.miranda at gmail.com
Fri Aug 31 16:19:28 UTC 2012


On Thu, Aug 30, 2012 at 3:10 PM, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

>
> strange test in line 73:
>                         if (!(size = sizeField(arg)))
>                                 size = argByteSize = sizeof(void *);
>                         else
>                                 argByteSize = abs(size);
>
> for me, it means
>
>                         if (sizeField(arg) != 0)
>                                 size = argByteSize = sizeof(void *);
>                         else
>                                 size = argByteSize = 0;
>

you have it the wrong way round.  It is equivalent to

                        size = sizeField(arg);
                        if (!size)
                                size = argByteSize = sizeof(void *);
                        else
                                argByteSize = abs(size);

which is equivalent to

                        size = sizeField(arg);
                        if (size == 0)
                                size = argByteSize = sizeof(void *);
                        else
                                argByteSize = abs(size);


> is it intentional ?
>

yes.


>
> Nicolas
>



-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120831/6de82654/attachment.htm


More information about the Vm-dev mailing list