aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4mm.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-01 10:21:27 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-12-02 09:56:13 +0100
commit1eedf91fcde959f5ac799f339384f44c6a9d0fd9 (patch)
tree47622bd2280dd272e438771ed769d6f4d2f8f2b8 /src/qml/jsruntime/qv4mm.cpp
parent06fc202e81bfbf619ceebb9cef803270590f9e7f (diff)
Regression: Fix array data corruption
When inserting into a sparse JS array, we may have to re-allocate the underlying data vector. When that happens we must reload the ArrayData pointer, to avoid returning a wrong pointer in ArrayData::insert. This patch also fixes the valgrind support in the memory allocator by correctly marking the mmap'ed memory region as inaccessible. Change-Id: I86aabc2cec74a4f3c8396463910d90c8968a741d Task-number: QTBUG-42956 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4mm.cpp')
-rw-r--r--src/qml/jsruntime/qv4mm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index b9a4a55b4a..975a5d5833 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -245,7 +245,7 @@ Managed *MemoryManager::allocData(std::size_t size)
m_d->availableItems[pos] += uint(increase);
m_d->totalItems += int(increase);
#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(allocation.memory, allocation.chunkSize);
+ VALGRIND_MAKE_MEM_NOACCESS(allocation.memory.base(), allocSize);
#endif
}