[Webkit-unassigned] [Bug 132947] Build error in Source/WebCore/fileapi/Blob.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 15 09:29:23 PDT 2014


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


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #231500|review?                     |review-
               Flag|                            |




--- Comment #2 from Alexey Proskuryakov <ap at webkit.org>  2014-05-15 09:29:46 PST ---
(From update of attachment 231500)
View in context: https://bugs.webkit.org/attachment.cgi?id=231500&action=review

> Source/WebCore/fileapi/Blob.cpp:127
> +        m_size = (actualSize <= std::numeric_limits<unsigned long long>::max()) ? static_cast<long long>(actualSize) : 0;

The proposed code is incorrect - an unsigned long long value is always less than or equal to std::numeric_limits<unsigned long long>::max(), so comparing these makes is meaningless. The purpose of this check is to ensure that casting to a signed long long won't change the value.

I think that you need something like:

m_size = (actualSize <= static_cast<unsigned long long>(std::numeric_limits<long long>::max())) ? static_cast<long long>(actualSize) : 0;

Or there may be some other idiom that I'm not aware of. Possibly something in CheckedArithmetic.h?

-- 
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