On Sat, Nov 24, 2012 at 3:39 PM, Igor Stasenko
<siguctua@gmail.com> wrote:
okay, seems like i found why:
NBExternalAddress>>ulongAt: zeroBasedOffset put: value
"Store unsigned 64-bit integer into memory at (receiver's address +
ZERO-based offset) using native byte order.
� � � � Note, there is no range checking "
It should use 32-bit values..
Callback code using ulongAt:put. to store single value at certain
address in machine code.
Since it stores 64-bit value instead of 32bit, it overrides the
instructions which follow, and of course that leads to crash.
Trait aliases.. is wrong:
#longAt:->#nbInt64AtOffset:. #longAt:put:->#nbInt64AtOffset:put:.
#ulongAt:->#nbUInt64AtOffset:. #ulongAt:put:->#nbUInt64AtOffset:put:
another reason to get rid of confusion with C types..
Yep indeed... that's the issue ... I have corrected it locally, but I cannot commit it (it seems I'm not in the developers list anymore):
NBExternalHandle variableByteSubclass: #NBExternalAddress
uses: TNBMemoryAccessors @ {#byteAt:->#nbInt8AtOffset:. #byteAt:put:->#nbInt8AtOffset:put:. #longAt:->#nbInt32AtOffset:. #longAt:put:->#nbInt32AtOffset:put:. #ulongAt:->#nbUInt32AtOffset:. #ulongAt:put:->#nbUInt32AtOffset:put:}
Cheers,
Ciprian
--
Best regards,
Igor Stasenko.