W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] How should overflow be handled when parsing integers?

From: Daniel Bates <dbates@webkit.org>
Date: Sun, 16 Oct 2011 05:17:19 -0700
Message-ID: <032DF324-A752-4647-90F0-1EDBF917F3C7@webkit.org>
(Please disregard this email if you already received a copy of it)

How should overflow be handled when parsing integers?

Step 8 of the parsing algorithm in both <http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-integers> and <http://dev.w3.org/html5/spec/Overview.html#non-negative-integers> doesn't mention how to handle integer overflow when interpreting the result of a sequence of base-ten integers.

Currently in WebKit we consider such overflow a parsing error. Is there any reason not to consider overflow a parsing error? Regardless, I suggest codifying the handling of overflow in the aforementioned sections.

This issue came up recently in WebKit with respect to the parsing of the maxlength attribute (https://bugs.webkit.org/show_bug.cgi?id=68981). 

Dan
Received on Sunday, 16 October 2011 05:17:19 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:37 UTC