diff options
Diffstat (limited to 'vm/compiler/Utility.c')
-rw-r--r-- | vm/compiler/Utility.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vm/compiler/Utility.c b/vm/compiler/Utility.c index 711d4cf3f..daeb8937c 100644 --- a/vm/compiler/Utility.c +++ b/vm/compiler/Utility.c @@ -277,7 +277,8 @@ bool dvmCompilerSetBit(BitVector *pBits, int num) if (!pBits->expandable) return false; - int newSize = (num + 31) >> 5; + /* Round up to word boundaries for "num+1" bits */ + int newSize = (num + 1 + 31) >> 5; assert(newSize > pBits->storageSize); u4 *newStorage = dvmCompilerNew(newSize * sizeof(u4), false); memcpy(newStorage, pBits->storage, pBits->storageSize * sizeof(u4)); |