[m-dev.] Re: changes to string module

Paul Bone pbone at csse.unimelb.edu.au
Fri Jan 30 12:41:33 AEDT 2009


On Fri, Jan 30, 2009 at 11:06:44AM +1100, Ralph Becket wrote:
> Julien Fischer, Thursday, 29 January 2009:
> > 
> > Hi Ralph,
> > 
> > I've had to back out your recent change to the string module (r1.277 of 
> > library/string.m) as the compiler no longer bootstraps on 32-bit machines
> > with it.  The lexer fails to recognise the hex literals in, for example,
> > compiler/make.util.m:1732 or compiler/elds_to_erlang.m:938.
> 
> Hmm.  That constants in question are 0xfe3dbe7f and 0xffffffff.  To get
> around the overflow check these should be -0x1c24181 and -0x1, but
> that feels rather unnatural.  Maybe the overflow check should only apply
> to base 10 numbers?

A 32bit hex signed or unsigned number would only ever overflow if it's
being converted from text if it has more than 8 digits.  Perhaps this
can be used to check for overflows (and 16 digits for 64 bit numbers).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/developers/attachments/20090130/b3fa3c4e/attachment.sig>


More information about the developers mailing list