[webkit-reviews] review granted: [Bug 129746] JSDataViewPrototype::getData() and setData() crash on platforms that don't allow unaligned accesses : [Attachment 225894] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 5 11:43:40 PST 2014


Filip Pizlo <fpizlo at apple.com> has granted Michael Saboff <msaboff at apple.com>'s
request for review:
Bug 129746: JSDataViewPrototype::getData() and setData() crash on platforms
that don't allow unaligned accesses
https://bugs.webkit.org/show_bug.cgi?id=129746

Attachment 225894: Patch
https://bugs.webkit.org/attachment.cgi?id=225894&action=review

------- Additional Comments from Filip Pizlo <fpizlo at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=225894&action=review


R=me if you add some squigles.

> Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp:181
>      if (needToFlipBytesIfLittleEndian(littleEndian))
> -	   value = flipBytes(value);
> -    
> -    *reinterpret_cast<typename
Adaptor::Type*>(static_cast<uint8_t*>(dataView->vector()) + byteOffset) =
value;
> -    
> +	   for (unsigned i = dataSize; i--;)
> +	       *dataPtr++ = u.rawBytes[i];
> +    else
> +	   for (unsigned i = 0; i < dataSize; i++)
> +	       *dataPtr++ = u.rawBytes[i];

You need some squigly braces {} here.


More information about the webkit-reviews mailing list