Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 9564eb6507b261b7b68c8334796e0243a35a0faf..7ad556476ecb873cd3ee6d143111e0360d534618 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -1286,7 +1286,12 @@ class SparseSet { |
: capacity_(capacity), |
length_(0), |
dense_(zone->NewArray<int>(capacity)), |
- sparse_(zone->NewArray<int>(capacity)) {} |
+ sparse_(zone->NewArray<int>(capacity)) { |
+#ifndef NVALGRIND |
+ // Initialize the sparse array to make valgrind happy. |
+ memset(sparse_, 0, sizeof(sparse_[0]) * capacity); |
+#endif |
+ } |
bool Contains(int n) const { |
ASSERT(0 <= n && n < capacity_); |