Created attachment 579930 [details] testcase The attached testcase gives different results in v8 and spidermonkey. It writes inifinity, and v8 prints that when it is read, but spidermonkey returns a large finite number. The tricky bit is that this code avoid "alignment problems" by writing the 64-bit double to a temp buffer, which it knows is 64-bit aligned, then uses that to write the 64-bit value in two parts to the main memory array. The same thing is done on read. (This is needed in emscripten because 64-bit doubles are not 64-bit aligned, necessarily, they are only 32-bit aligned. So the temp buffer is 64-bit aligned, and helps get around potential lack of alignment in the main buffer.)
Ah, nevermind. The issue is that Infinity is not a NaN as a 64-bit double, but it is a NaN as a 32-bit double. That triggers the NaN-modifying code. So going through 32-bit floats breaks the Infinity double into something else.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.