Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 8d7244b6a91511a6c511f9bd956de99bd99a8d1f..28c6ebb47ed393300ff5e9a73de2b6b5b06f51d4 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -717,7 +717,9 @@ Object* Object::GetHash() { |
// The object is either a number, a name, an odd-ball, |
// a real JS object, or a Harmony proxy. |
if (IsNumber()) { |
- uint32_t hash = ComputeLongHash(double_to_uint64(Number())); |
+ uint32_t hash = std::isnan(Number()) |
+ ? Smi::kMaxValue |
+ : ComputeLongHash(double_to_uint64(Number())); |
return Smi::FromInt(hash & Smi::kMaxValue); |
} |
if (IsName()) { |