| Summary: | JSDataViewPrototype::getData() and setData() crash on platforms that don't allow unaligned accesses | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Saboff <msaboff> | ||||
| Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | ||||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Michael Saboff
2014-03-05 10:54:35 PST
Created attachment 225894 [details]
Patch
Comment on attachment 225894 [details] Patch 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. Committed r165121: <http://trac.webkit.org/changeset/165121> |