Fix GC for the last object in a chunk.
authorErik Verbruggen <erik.verbruggen@me.com>
Tue, 5 Feb 2013 21:49:26 +0000 (22:49 +0100)
committerLars Knoll <lars.knoll@digia.com>
Wed, 6 Feb 2013 07:51:13 +0000 (08:51 +0100)
heapChunkBoundariesEnd points to the last entry in a chunk, so include
it as a valid address to be candidate for marking.

Change-Id: Ieb1fbb494ae2fd8ee5d38ae59529cf441fbcd729
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/v4/qv4mm.cpp

index 8e85001..7e60e00 100644 (file)
@@ -370,7 +370,7 @@ void MemoryManager::collectFromStack() const
                 reinterpret_cast<char *>(*current);
 #endif
 
-        if (genericPtr < *heapChunkBoundaries || genericPtr >= *(heapChunkBoundariesEnd - 1))
+        if (genericPtr < *heapChunkBoundaries || genericPtr > *(heapChunkBoundariesEnd - 1))
             continue;
         int index = qLowerBound(heapChunkBoundaries, heapChunkBoundariesEnd, genericPtr) - heapChunkBoundaries;
         // An odd index means the pointer is _before_ the end of a heap chunk and therefore valid.