[FIX] When (1063751680 < 1063751679) is true!

Bert Freudenberg bert at impara.de
Sun Feb 1 23:37:12 UTC 2004


Am 01.02.2004 um 02:00 schrieb Peter William Lount:
> I'm not quite sure what this bug is but it sure drove me crazy for 
> hours
> trying to find it. Of course I assumed that
>
> (1063751680 < 1063751679)
>
>  would be false, but I found a case where it's true! Yikes!
>
> Ok here is a code fragment which reproduces the problem. The start and 
> end
> variables that I'm constructing are ip addresses or 32 bit integers.
>
>      | aStart anEnd aRange anIndex aList |
>      "Specify the temporary variables so you can see them in the 
> debugger"
>      aStart := Integer byte1: 0 byte2: 140 byte3: 103 byte4: 63.
>      anEnd := Integer byte1: 255 byte2: 143 byte3: 103 byte4: 63.
>     "At this point the above produces two LargePositiveIntegers"

Which is wrong - it is illegal for a LargeInteger to be less than 
SmallInteger maxVal. Here is a fix:

"Change Set:		intNewFix-bf
Date:			2 February 2004
Author:			Bert Freudenberg

Fixes a bug in Integer class>>byte1:byte2:byte3:byte4: reported by 
Peter William Lount"

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: intNewFix-bf.1.cs.gz
Type: application/x-gzip
Size: 479 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040202/3be53ea4/intNewFix-bf.1.cs.bin


More information about the Squeak-dev mailing list