diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-06 09:35:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 12:44:08 +0100 |
commit | 50ce88a53107f97664d928719c1877b8077e9a2e (patch) | |
tree | a43fdc574cf5028517443514b5d56be221b86dd1 /src/qml/qml/ftw | |
parent | d5a96399cec189251d8ee3e82493aceec112fbd8 (diff) |
[new compiler] Fix parser status and created bindings allocation
Pre-calculate the amount of space we need for binding and parser status
callbacks at compile time and therefore use a much simpler data structure
(vector) to store the points to the bindings and callbacks. They need to be
stored because during object construction and binding enabling phase, it may
happen that they get destroyed and thus their m_mePtr pointing into the array
gets deleted.
The contiguous vector will also make it possible to interrupt the completion
phase.
Change-Id: Ic7c985bb8325ab355112e30e9d33d6ae4e7476d1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/ftw')
-rw-r--r-- | src/qml/qml/ftw/qfinitestack_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/ftw/qfinitestack_p.h b/src/qml/qml/ftw/qfinitestack_p.h index 31a530fa64..6bfd353771 100644 --- a/src/qml/qml/ftw/qfinitestack_p.h +++ b/src/qml/qml/ftw/qfinitestack_p.h @@ -114,6 +114,7 @@ T &QFiniteStack<T>::top() template<typename T> void QFiniteStack<T>::push(const T &o) { + Q_ASSERT(_size < _alloc); if (QTypeInfo<T>::isComplex) { new (_array + _size++) T(o); } else { @@ -124,6 +125,7 @@ void QFiniteStack<T>::push(const T &o) template<typename T> T QFiniteStack<T>::pop() { + Q_ASSERT(_size > 0); --_size; if (QTypeInfo<T>::isComplex) { |