| Index: runtime/lib/byte_array.cc
|
| diff --git a/runtime/lib/byte_array.cc b/runtime/lib/byte_array.cc
|
| index f9a993a8e48a87e4a7f23ce898066bd11018d3aa..f105320b99dd47069bb946ab9410e9b11729f069 100644
|
| --- a/runtime/lib/byte_array.cc
|
| +++ b/runtime/lib/byte_array.cc
|
| @@ -61,8 +61,11 @@ static void RangeCheck(const ByteArray& array,
|
| #define UNALIGNED_SETTER(ArrayT, ObjectT, Getter, ValueT) \
|
| SETTER_ARGUMENTS(ArrayT, ObjectT, ValueT); \
|
| RangeCheck(array, index.Value(), sizeof(ValueT)); \
|
| - ValueT src = value_object.Getter(); \
|
| - ByteArray::Copy(array, index.Value(), &src, sizeof(ValueT));
|
| + ValueT src = value_object.Getter(); \
|
| + ByteArray::Copy(array, index.Value(), &src, sizeof(ValueT)); \
|
| + Integer& result = Integer::Handle(); \
|
| + result ^= Integer::New(index.Value() + sizeof(ValueT)); \
|
| + arguments->SetReturn(result);
|
|
|
|
|
| #define UINT64_TO_INTEGER(value, integer) \
|
| @@ -121,7 +124,10 @@ static void RangeCheck(const ByteArray& array,
|
| RangeCheck(array, index.Value(), sizeof(uint64_t)); \
|
| uint64_t value; \
|
| INTEGER_TO_UINT64(value_object, value); \
|
| - ByteArray::Copy(array, index.Value(), &value, sizeof(uint64_t));
|
| + ByteArray::Copy(array, index.Value(), &value, sizeof(uint64_t)); \
|
| + Integer& result = Integer::Handle(); \
|
| + result ^= Integer::New(index.Value() + sizeof(uint64_t)); \
|
| + arguments->SetReturn(result);
|
|
|
|
|
| DEFINE_NATIVE_ENTRY(ByteArray_getLength, 1) {
|
|
|