[Webkit-unassigned] [Bug 80465] Integer overflow check code in arithmetic operation in classic interpreter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 7 00:24:43 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=80465





--- Comment #1 from Gavin Barraclough <barraclough at apple.com>  2012-03-07 00:24:43 PST ---
(In reply to comment #0)
> I wonder if is a mistake, and the original intention is 

Ouch, yes, I think you're right.

> Although, it is conservative, but is fast and simple check.

Yes, that is the intention.

> If both src1 and src2 have most 16 significant bits as zero, no overflow can occurs.

Yes, again I think you're right.

One detail, actually you need the top 17 bits to be zero.  Multiplying two 16 bit values requires nearly the full 32-bit range (2^16 - 1)^2 == 2^32 - 2^17 + 1, so cannot be  represented with a signed integer.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list