[Vm-dev] Integer overflow with BitBlt rule 20 and depth 32
David T. Lewis
lewis at mail.msen.com
Tue Oct 20 13:56:01 UTC 2009
Could this be the cause of issue for which Juan was asking help?
Subject line "[Vm-dev] Bug in BitBlt. Need Help."
http://lists.squeakfoundation.org/pipermail/vm-dev/2009-September/003160.html
On Tue, Oct 20, 2009 at 12:24:22AM +0200, Henrik Johansen wrote:
>
> Any combination of alpha values with a sum greater than 383 will
> cause an overflow, and return an alpha of sum - 255.
>
> Works correctly in BitBltSimulator, but the generated x86 C-code fails.
>
> Reproduced on latest versions of both Windows and MacOSX VMs. (I don't
> have a Linux install)
> Not quite sure of the best way to fix this (and possibly other
> similarily effected rules when depth is 32)
>
> Cheers,
> Henry
>
> Tests:
>
> sourceForm destForm blt|
> destForm := Form extent: 1 at 1 depth: 32.
> destForm bits at: 1 put: ((192 << 24) + (255 << 16) + (255 << 8) +
> 255).
> sourceForm := Form extent: 1 at 1 depth: 32.
> sourceForm bits at: 1 put: ((192 << 24) + (33 << 16) + (25 << 8) + 27).
> blt := BitBlt new.
> blt sourceForm: sourceForm.
> blt sourceOrigin: 0 at 0.
> blt setDestForm: destForm.
> blt destOrigin: 0 at 0.
> blt combinationRule: 20.
> blt copyBits.
> ((blt destForm bits at: 1) digitAt: 4) = 255
>
> - Using Simulator:
> |word1 word2|
> word1 := (192 << 24) + (255 << 16) + (255 << 8) + 255.
> word2 := (192 << 24) + (33 << 16) + (25 << 8) + 27.
> ((BitBltSimulator new initBBOpTable partitionedAdd: word1 to: word2
> nBits: 8
> nPartitions: 4) digitAt: 4) = 255
More information about the Vm-dev
mailing list