[Webkit-unassigned] [Bug 59477] Loss of precission errors throughout the codebase spotted by GCC 4.6

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 16:33:11 PDT 2011


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


Alexey Proskuryakov <ap at webkit.org> changed:

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




--- Comment #2 from Alexey Proskuryakov <ap at webkit.org>  2011-04-26 16:33:11 PST ---
(From update of attachment 91136)
View in context: https://bugs.webkit.org/attachment.cgi?id=91136&action=review

I think that this should be split into parts that domain experts could look at.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2102
> +    SwitchInfo info = { static_cast<uint32_t>(instructions().size()), type };

I think that this patch is making things worse in that once this warning is enabled in some other compiler, we won't see the issues. It's not obvious to me that malicious code can't create 4 billion instructions.

> Source/JavaScriptCore/wtf/unicode/UTF8.cpp:236
> +static const UChar32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, static_cast<const UChar32>(0xFA082080UL), static_cast<const UChar32>(0x82082080UL) };

Can this be fixed by not using UChar32? These are not Unicode characters, these are magic numbers.

> Source/WebCore/plugins/PluginPackage.cpp:348
> +        static_cast<unsigned int>(m_lastModified)

We don't use "unsigned int", we use "unsigned".

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