If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Float32 to Float64 (resp. Float32 to Float64) typed array constructor needs to canonicalize NaNs

NEW
Unassigned

Status

()

Core
JavaScript: Standard Library
P3
normal
27 days ago
6 days ago

People

(Reporter: André Bargull, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox57 affected)

Details

(Reporter)

Description

27 days ago
Test case:
---
var ta = new Float32Array(2);
new Uint32Array(ta.buffer)[0] = 0x7f800005;
new Uint32Array(ta.buffer)[1] = 0x7f800007;

var tb = new Float32Array(new Float64Array(ta));
print(new Uint32Array(tb.buffer)[0].toString(16));
print(new Uint32Array(tb.buffer)[1].toString(16));
---

Expected:
- NaN payload is removed

Actual:
- NaN payload is still present


https://tc39.github.io/ecma262/#sec-typedarray-typedarray calls GetValueFromBuffer (https://tc39.github.io/ecma262/#sec-getvaluefrombuffer), which in turn calls RawBytesToNumber (https://tc39.github.io/ecma262/#sec-rawbytestonumber), which canonicalizes NaN values.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.