Closed Bug 1543659 Opened 6 years ago Closed 6 years ago

TypedArray broken on 64-bit big endian

Categories

(Core :: JavaScript Engine, defect, P5)

Other
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jcristau, Unassigned)

References

Details

Attachments

(1 obsolete file)

The JSPropertySpec::ValueWrapper struct contains a union with a pointer and a int32. When writing an int through JS_INT32_PS → INT32VALUE_WRAPPER we actually cast the int32 to a pointer and write to the pointer slot.

Then when we read it back through the int32 member, we end up getting the high-order 32 bits of the pointer, which are 0.

This breaks at least TypedArrays' BYTES_PER_ELEMENT property.

Add some padding to make the union's int32 member correspond to the
low-order bits of the string member. This fixes TypedArray tests on
platforms such as s390x, ppc64 and sparc64.

See Also: → 1488552

Looks like this code comes from bug 1015798.

Depends on: 1543843

Bug 1543843 fixes this.

Assignee: jcristau → nobody
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Attachment #9057639 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: