[Vm-dev] Problem with inferred types

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Mar 14 23:34:58 UTC 2015


Hi,
this sounds like a problem occuring with inferred types
(CCodeGenerator>>returnTypeForSend:in:)
For example, in translation of BitBltSimulation>>sourceSkewAndPointerInit
    sxLowBits := sx bitAnd: pixPerM1.
    dxLowBits := dx bitAnd: pixPerM1.
snip...
    ifFalse:
        [dWid := bbW min: dxLowBits + 1.
        preload := (sxLowBits - dWid + 1) < 0].

This gives those types:
    sqInt dWid;
    usqInt dxLowBits;
    usqInt sxLowBits;

And the last line gives a nice warning:
                preload = ((sxLowBits - dWid) + 1) < 0;  <- comparison of
unsigned expression < 0 is allways false

Yet another wonderful case of unwanted promotion to unsigned...

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150315/983957b5/attachment.htm


More information about the Vm-dev mailing list