JSDataViewPrototype::getData() and setData() crash on platforms that don't allow...
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2014 21:01:35 +0000 (21:01 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2014 21:01:35 +0000 (21:01 +0000)
commit1705b6fbd597c17e9e31b31b2faa3d613f25d253
treeaab415ec06741874ae243ae775a0a27055a483ee
parent5f71debd95d4def8fff2f45190f9c5ef5dc0df00
JSDataViewPrototype::getData() and setData() crash on platforms that don't allow unaligned accesses
https://bugs.webkit.org/show_bug.cgi?id=129746

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Changed to use a union to manually assemble or disassemble the various types
from / to the corresponding bytes.  All memory access is now done using
byte accesses.

* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):

LayoutTests:

New test to validate proper operation of DataView operations at
various byte offsets using both little and big endian.

* js/arraybuffer-dataview-expected.txt: Added.
* js/arraybuffer-dataview.html: Added.
* js/script-tests/arraybuffer-dataview.js: Added.
(paddedHex):
(byteString):
(clearView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/arraybuffer-dataview-expected.txt [new file with mode: 0644]
LayoutTests/js/arraybuffer-dataview.html [new file with mode: 0644]
LayoutTests/js/script-tests/arraybuffer-dataview.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp