OSDN Git Service

Update storage size after expansion.
authorAndy McFadden <fadden@android.com>
Wed, 19 Aug 2009 17:32:01 +0000 (10:32 -0700)
committerAndy McFadden <fadden@android.com>
Wed, 19 Aug 2009 17:32:01 +0000 (10:32 -0700)
We allow expansion in dvmSetBit(), but failed to update the capacity
after doing so.

vm/Misc.c

index 6b1372c..f8f7256 100644 (file)
--- a/vm/Misc.c
+++ b/vm/Misc.c
@@ -280,6 +280,7 @@ bool dvmSetBit(BitVector* pBits, int num)
         pBits->storage = realloc(pBits->storage, newSize * sizeof(u4));
         memset(&pBits->storage[pBits->storageSize], 0x00,
             (newSize - pBits->storageSize) * sizeof(u4));
+        pBits->storageSize = newSize;
     }
 
     pBits->storage[num >> 5] |= 1 << (num & 0x1f);