summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt CI Bot <qt_ci_bot@qt-project.org>2021-04-07 16:50:55 +0000
committerQt CI Bot <qt_ci_bot@qt-project.org>2021-04-07 16:50:55 +0000
commitfecba62d3208bc9e0417084fc58c727e1b132702 (patch)
treeb3f2b679aa441ca21386effccdff891574cbe2fc /src/corelib
parent30d5e13768d970e538737d1740898f59157e6017 (diff)
parentdf54a5d087d7e3a5cf20bb34fefd8d643a7b2f58 (diff)
Merge integration refs/builds/qtci/dev/1617798649
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp8
-rw-r--r--src/corelib/thread/qsemaphore.cpp19
2 files changed, 18 insertions, 9 deletions
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 9fb66b023a..a5bb56245a 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -3001,8 +3001,9 @@ bool QSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &
if (d->filter_data.pattern().isEmpty())
return true;
+
+ int column_count = d->model->columnCount(source_parent);
if (d->filter_column == -1) {
- int column_count = d->model->columnCount(source_parent);
for (int column = 0; column < column_count; ++column) {
QModelIndex source_index = d->model->index(source_row, column, source_parent);
QString key = d->model->data(source_index, d->filter_role).toString();
@@ -3011,9 +3012,10 @@ bool QSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &
}
return false;
}
- QModelIndex source_index = d->model->index(source_row, d->filter_column, source_parent);
- if (!source_index.isValid()) // the column may not exist
+
+ if (d->filter_column >= column_count) // the column may not exist
return true;
+ QModelIndex source_index = d->model->index(source_row, d->filter_column, source_parent);
QString key = d->model->data(source_index, d->filter_role).toString();
return d->filter_data.match(key).hasMatch();
}
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 5111d80ac6..45983d47ab 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -200,14 +200,21 @@ futexSemaphoreTryAcquire_loop(QBasicAtomicInteger<quintptr> &u, quintptr curValu
// indicate we're waiting
start_wait:
- auto ptr = futexLow32(&u);
+ auto ptr = [&u]() {
+ if constexpr (futexHasWaiterCount)
+ return futexLow32(&u);
+ else
+ return &u;
+ }();
if (n > 1 || !futexHasWaiterCount) {
u.fetchAndOrRelaxed(futexNeedsWakeAllBit);
curValue |= futexNeedsWakeAllBit;
- if (n > 1 && futexHasWaiterCount) {
- ptr = futexHigh32(&u);
- //curValue >>= 32; // but this is UB in 32-bit, so roundabout:
- curValue = quint64(curValue) >> 32;
+ if constexpr (futexHasWaiterCount) {
+ if (n > 1) {
+ ptr = futexHigh32(&u);
+ // curValue >>= 32; // but this is UB in 32-bit, so roundabout:
+ curValue = quint64(curValue) >> 32;
+ }
}
}
@@ -397,7 +404,7 @@ void QSemaphore::release(int n)
futexWakeOp(*futexLow32(&u), n, INT_MAX, *futexHigh32(&u), FUTEX_OP(op, oparg, cmp, cmparg));
}
#else
- // Unset the bit and wake everyone. There are two possibibilies
+ // Unset the bit and wake everyone. There are two possibilities
// under which a thread can set the bit between the AND and the
// futexWake:
// 1) it did see the new counter value, but it wasn't enough for