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

Esteban Lorenzano estebanlm at gmail.com
Thu Jan 5 08:59:07 UTC 2017


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


More information about the Vm-dev mailing list