[Ur] Bug with oversized int literals and hexadecimal ones bigger than 32 bits
Gabriel Riba
gabriel at xarxaire.com
Tue May 26 07:53:24 EDT 2015
Affected: urweb.lex
1. Oversized int literals throw an unhandled Overflow exception in SML
Basis Int64.fromString, making the lexer fail.
Documentation: http://sml-family.org/Basis/integer.html#SIG:INTEGER.scan:VAL
Adding
handle Overflow => NONE
solves it.
2. Hexadecimal literals are defined too shortly, and refuse values
bigger then 32 bits.
hexconst = 0x[0-9A-F]{1,8};
The actual definition with max. repetitions specifier, causes an
oversized literal to be split in two tokens making the error ugly.
It is better to accept the whole token and check for the Overflow when
converted, adding the exception handler as with the previous section.
(This bug is from a proposal of mine, so It was my fault)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: urweb.lex.patch
Type: text/x-patch
Size: 2291 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150526/d3d16478/attachment.bin>
More information about the Ur
mailing list