[Vm-dev] VM patches for oop comparison and usqInt declarations
John M McIntosh
johnmci at smalltalkconsulting.com
Tue May 8 01:52:40 UTC 2007
Ah well something else wrong I guess.
let's see -0x0A is 0xFFFFFFFF6
mmm add say + 4 is 0xFFFFFFFA or (-0x06)
need more coffee.
On May 7, 2007, at 6:35 PM, Bert Freudenberg wrote:
>
> On May 7, 2007, at 17:25 , John M McIntosh wrote:
>
>> Ok, I was working with Craig a bit on this and I noticed for example.
>>
>> usqInt endOfMemory;
>>
>> sqInt fwdBlock2;
>>
>> /* begin restoreHeadersAfterForwardBecome: */
>> fwdBlock2 = ((foo->endOfMemory + BaseHeaderSize) + 7) &
>> (WordMask - 7);
>> flag("Dan");
>> fwdBlock2 += BytesPerWord * 4;
>>
>>
>> Really shouldn't one consider that if a unsigned value gets
>> assigned to a signed integer one should really consider that a
>> possible problem?
>>
>> Needless to say I believe the code above won't work as intended.
>
>
> Shooting from the hip and all, but I'd say thanks to two's
> complement this actually should work. Far from pretty or desirable,
> but it should generate the same code (unless the C compiler inserts
> specific checks which it should not and AFAIK it does not).
>
> - Bert -
>
>
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Vm-dev
mailing list