[squeak-dev] Bit operators (was: Is anyone else running a 64-bit image on a regular basis?)

David T. Lewis lewis at mail.msen.com
Mon Sep 8 17:44:18 UTC 2014


> On 08.09.2014, at 18:28, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
>> On 08.09.2014, at 16:45, David Corking <lists at dcorking.com> wrote:
>>
>>> Did you have to work around it when designing SqueakJS ?
>>
>> Yes: https://github.com/bertfreudenberg/SqueakJS/commit/6d694d0733
>
> Yikes. I just spotted another bug in that function. Can you see it, too?

I think it should be using an unsigned right shift like this:

   if ((shifted>>>shiftCount) === smallInt) return shifted;

Dave

>
> (SmallIntegerTests did not uncover that bug, they all pass. Most tests
> assume a correct VM)
>
> (IntegerTest and IntegerDigitLogicTest contain too many brute-force tests,
> which time out on a slow VM. SqueakJS passes 44 of 60)
>
> (SqueakJS could use testers. But it's not much fun, opening a TestRunner
> in 4.5 takes like 30 seconds)
>
> - Bert -
>
>
>




More information about the Squeak-dev mailing list