[Vm-dev] changes in FFI-Kernel-eem.43 break 32bits version (at least for me)

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Jan 5 19:41:05 UTC 2017


Hi Esteban,
primitiveFFIIntegerAtPut can't operate on 64 int in a 32 bits vm as it is
now.
I'll commit a fix.

2017-01-05 9:59 GMT+01:00 Esteban Lorenzano <estebanlm at gmail.com>:

>
> Hi,
>
> I found that this change:
>
> unsignedLongLongAt: byteOffset
>         "Answer a 64-bit integer in Smalltalk order (little-endian)."
>         ^self integerAt: byteOffset size: 8 signed: false
>
> unsignedLongLongAt: byteOffset put: value
>         "I store 64-bit integers in Smalltalk (little-endian) order."
>         ^self integerAt: byteOffset put: value size: 8 signed: false
>
> … which makes sense at fist sight does not work at least for me. In 32bits
> scenario, this test will fail:
>
>  { -9223372036854775808. -9223372036854775807. -2147483649. -2147483648. -
> 2147483647. -32769. -32768. -32767. -129. -128. -127. 0. 126. 127. 128.
> 254. 255. 256. 32766. 32767. 32768. 65534. 65535. 65536. 2147483646.
> 2147483647. 2147483648. 9223372036854775806. 9223372036854775807 } do: [
> :int |
>                 |ref|
>                 ref := ByteArray new: 8.
>                 ref signedLongLongAt: 1 put: int.
>                 self assert: (ref signedLongLongAt: 1) = int ]
>
> can you confirm it?
>
> cheers,
> Esteban
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170105/5e552a35/attachment.html>


More information about the Vm-dev mailing list