aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4mm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/memory/qv4mm.cpp')
-rw-r--r--src/qml/memory/qv4mm.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 342e31da1b..7286b0ad27 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -473,12 +473,15 @@ void Chunk::sortIntoBins(HeapItem **bins, uint nBins)
uint freeStart = i*Bits + index;
usedSlots &= ~((static_cast<quintptr>(1) << index) - 1);
while (!usedSlots) {
- ++i;
- if (i == EntriesInBitmap) {
- usedSlots = (quintptr)-1;
+ if (++i < EntriesInBitmap) {
+ usedSlots = (objectBitmap[i]|extendsBitmap[i]);
+ } else {
+ Q_ASSERT(i == EntriesInBitmap);
+ // Overflows to 0 when counting trailing zeroes above in next iteration.
+ // Then, all the bits are zeroes and we break.
+ usedSlots = std::numeric_limits<quintptr>::max();
break;
}
- usedSlots = (objectBitmap[i]|extendsBitmap[i]);
#ifndef QT_NO_DEBUG
allocatedSlots += qPopulationCount(usedSlots);
// qDebug() << hex << " i=" << i << "used=" << usedSlots;