Fix bug in UnionIfNotIn.
Bug: 18066207
Change-Id: Ib9b24802546403b3d5a4da19996034eb45601f53
diff --git a/runtime/base/bit_vector.cc b/runtime/base/bit_vector.cc
index 3d2f0de..1d67962 100644
--- a/runtime/base/bit_vector.cc
+++ b/runtime/base/bit_vector.cc
@@ -145,10 +145,7 @@
// Is the storage size smaller than src's?
if (storage_size_ < union_with_size) {
- changed = true;
-
- // Set it to reallocate.
- SetBit(highest_bit);
+ EnsureSize(highest_bit);
// Paranoid: storage size should be big enough to hold this bit now.
DCHECK_LT(static_cast<uint32_t> (highest_bit), storage_size_ * kWordBits);