[qt] revert qlist.h commit that seems to induce crashes in qDeleteAll<QList... (QTBUG-22037)

Rex Dieter rdieter at fedoraproject.org
Sat Oct 15 19:27:16 UTC 2011


commit a9a1095ff8929e7c0e6b69e246a5a32ad3da17a9
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Sat Oct 15 14:34:35 2011 -0500

    revert qlist.h commit that seems to induce crashes in qDeleteAll<QList... (QTBUG-22037)

 ...erywhere-opensource-src-4.8.0-QTBUG-22037.patch |   41 ++++++++++++++++++++
 qt.spec                                            |    9 ++++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch b/qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch
new file mode 100644
index 0000000..4279ce2
--- /dev/null
+++ b/qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch
@@ -0,0 +1,41 @@
+diff -up qt-everywhere-opensource-src-4.8.0/src/corelib/tools/qlist.h.QTBUG-22037 qt-everywhere-opensource-src-4.8.0/src/corelib/tools/qlist.h
+--- qt-everywhere-opensource-src-4.8.0/src/corelib/tools/qlist.h.QTBUG-22037	2011-10-03 22:44:32.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.0/src/corelib/tools/qlist.h	2011-10-15 14:25:52.238694974 -0500
+@@ -769,26 +769,18 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::clea
+ template <typename T>
+ Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
+ {
+-    int index = indexOf(_t);
+-    if (index == -1)
+-        return 0;
+-
++    detachShared();
+     const T t = _t;
+-    detach();
+-
+-    Node *i = reinterpret_cast<Node *>(p.at(index));
+-    Node *e = reinterpret_cast<Node *>(p.end());
+-    Node *n = i;
+-    node_destruct(i);
+-    while (++i != e) {
+-        if (i->t() == t)
+-            node_destruct(i);
+-        else
+-            *n++ = *i;
+-    }
+-
+-    int removedCount = e - n;
+-    d->end -= removedCount;
++    int removedCount=0, i=0;
++    Node *n;
++    while (i < p.size())
++        if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) {
++            node_destruct(n);
++            p.remove(i);
++            ++removedCount;
++        } else {
++            ++i;
++        }
+     return removedCount;
+ }
+ 
diff --git a/qt.spec b/qt.spec
index aba3bf3..0e01b24 100644
--- a/qt.spec
+++ b/qt.spec
@@ -11,7 +11,7 @@ Summary: Qt toolkit
 Name:    qt
 Epoch:   1
 Version: 4.8.0
-Release: 0.14.rc1%{?dist}
+Release: 0.15.rc1%{?dist}
 
 # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
 License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@@ -76,6 +76,9 @@ Patch67: qt-everywhere-opensource-src-4.8.0-beta1-s390.patch
 # -Wall + -Werror = fail
 Patch68: webkit-qtwebkit-2.2-no_Werror.patch
 
+# revert qlist.h commit that seems to induce crashes in qDeleteAll<QList (QTBUG-22037)
+Patch69: qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch
+
 # upstream patches
 
 # security patches
@@ -392,6 +395,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
 pushd src/3rdparty/webkit
 %patch68 -p1 -b .no_Werror
 popd
+%patch69 -p1 -b .QTBUG-22037
 
 # upstream patches
 
@@ -1024,6 +1028,9 @@ fi
 
 
 %changelog
+* Sat Oct 15 2011 Rex Dieter <rdieter at fedoraproject.org> 4.8.0-0.15.rc1
+- revert qlist.h commit that seems to induce crashes in qDeleteAll<QList... (QTBUG-22037)
+
 * Sat Oct 15 2011 Rex Dieter <rdieter at fedoraproject.org> 4.8.0-0.14.rc1
 - pkgconfig-style deps
 


More information about the scm-commits mailing list