summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-09-27 14:31:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-27 23:51:30 +0200
commitf9547c89ea9fd0e6d571db840c5cadab079df607 (patch)
tree6f408928dd85bc758a5b264595490872b563dfc0 /src/corelib/thread
parentb0a7974c6af1e81876caf52602e5c9be7dde5077 (diff)
QPostEventList: change pointer comparison to integer comparison
This is exactly the type of pointer arithmetics that GCC likes to miscompile. Just use offset >= size() (=subtract begin() from both sides). Change-Id: Ifb13652d7b96bf4c06727d9c965516e95d16ab5c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 0667a814c3..268891d5e8 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -114,7 +114,7 @@ public:
int priority = ev.priority;
if (isEmpty() ||
last().priority >= priority ||
- begin() + insertionOffset >= end()) {
+ insertionOffset >= size()) {
// optimization: we can simply append if the last event in
// the queue has higher or equal priority
append(ev);