Index: src/crankshaft/hydrogen-instructions.cc |
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc |
index be1ac9a18c2f2a2a87f8ffca3054c693663a74c4..26bbf2fcd374a2914446acd2c547b8e963c5d7b7 100644 |
--- a/src/crankshaft/hydrogen-instructions.cc |
+++ b/src/crankshaft/hydrogen-instructions.cc |
@@ -2177,6 +2177,11 @@ HConstant::HConstant(Special special) |
InstanceTypeField::encode(kUnknownInstanceType)), |
int32_value_(0) { |
DCHECK_EQ(kHoleNaN, special); |
+ // Manipulating the signaling NaN used for the hole in C++, e.g. with bit_cast |
+ // will change its value on ia32 (the x87 stack is used to return values |
+ // and stores to the stack silently clear the signalling bit). |
+ // Therefore we have to use memcpy for initializing |double_value_| with |
+ // kHoleNanInt64 here. |
std::memcpy(&double_value_, &kHoleNanInt64, sizeof(double_value_)); |
Initialize(Representation::Double()); |
} |