Bug 1312488 - Assign whole layout instead of layout.asDouble in JS::Value::setDoubleNoCheck. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Thu, 27 Oct 2016 22:57:40 +0900
changeset 319830 045cb5724eaf1a34be2748e59ee2ebd353d24f4b
parent 319829 15775247c226598e8b00a5229c4f2c20a35b2c3a
child 319831 1bd14dd39440eeef1e29dfc4d4427ad176828a88
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1312488
milestone52.0a1
Bug 1312488 - Assign whole layout instead of layout.asDouble in JS::Value::setDoubleNoCheck. r=jandem
js/public/Value.h
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -327,17 +327,19 @@ class MOZ_NON_PARAM alignas(8) Value
     }
 
     void setDouble(double d) {
         setDoubleNoCheck(d);
         MOZ_ASSERT(isDouble());
     }
 
     void setDoubleNoCheck(double d) {
-        data.asDouble = d;
+        // Don't assign to data.asDouble to fix a miscompilation with
+        // GCC 5.2.1 and 5.3.1. See bug 1312488.
+        data = layout(d);
     }
 
     void setNaN() {
         setDouble(GenericNaN());
     }
 
     double& getDoubleRef() {
         MOZ_ASSERT(isDouble());