Bug 126924

Summary: Add uint8_t specialization for WebCore::writeLittleEndian()
Product: WebKit Reporter: Daniel Bates <dbates>
Component: BindingsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, alecflett, commit-queue, darin, ddkilzer, fpizlo, ggaren, jsbell, mhahnenberg, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch darin: review+

Description Daniel Bates 2014-01-13 11:53:25 PST
When I ran Tools/Scripts/build-webkit --debug --device, the build failed to compile SerializedScriptValue.cpp with the following error:
 
/OpenSource/Source/WebCore/bindings/js/SerializedScriptValue.cpp:421:19: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
/OpenSource/Source/WebCore/bindings/js/SerializedScriptValue.cpp:967:9: note: in instantiation of function template specialization 'WebCore::writeLittleEndian<unsigned char>' requested here
1 error generated.
Comment 1 Daniel Bates 2014-01-13 11:54:13 PST
Created attachment 221069 [details]
Patch
Comment 2 Darin Adler 2014-01-13 11:58:52 PST
Comment on attachment 221069 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=221069&action=review

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:431
> +    if (length > std::numeric_limits<uint32_t>::max())
> +        return false;

This can’t happen. A uint32_t can’t be higher than the maximum.
Comment 3 Daniel Bates 2014-01-13 12:01:16 PST
Created attachment 221070 [details]
Patch
Comment 4 Daniel Bates 2014-01-13 12:02:22 PST
(In reply to comment #2)
> (From update of attachment 221069 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221069&action=review
> 
> > Source/WebCore/bindings/js/SerializedScriptValue.cpp:431
> > +    if (length > std::numeric_limits<uint32_t>::max())
> > +        return false;
> 
> This can’t happen. A uint32_t can’t be higher than the maximum.

You're right! I removed this conditional.
Comment 5 Daniel Bates 2014-01-13 12:52:02 PST
Committed r161903: <http://trac.webkit.org/changeset/161903>