summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-04-11 16:31:11 +0200
committerKai Koehne <kai.koehne@nokia.com>2011-04-11 16:31:50 +0200
commitd2a1610dcea39c03fae86e93ae27bbbc603a2bd1 (patch)
treeda3e38f3680da4bdbd63f17893d429ad2787405c
parent184c97add1bcada4863154caba42075a17c2eca8 (diff)
downloadqt-creator-d2a1610dcea39c03fae86e93ae27bbbc603a2bd1.tar.gz
QmlDebug: Fix crash on Mac OS X
Work-around for what seems to be an optimization bug in i686-apple-darwin9-gcc-4.2.1 . Without it, for i = 1 i - 1 != 0 . Task-number: QTCREATORBUG-4107 Reviewed-by: hjk
-rw-r--r--src/libs/utils/crumblepath.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/utils/crumblepath.cpp b/src/libs/utils/crumblepath.cpp
index 712c573847..a9c68c19c1 100644
--- a/src/libs/utils/crumblepath.cpp
+++ b/src/libs/utils/crumblepath.cpp
@@ -363,8 +363,13 @@ void CrumblePath::resizeButtons()
nextElementPosition.rx() += button->width() - ArrowBorderSize;
button->show();
- if (i > 0)
- button->stackUnder(d->m_buttons[i - 1]);
+ if (i > 0) {
+ // work-around for a compiler / optimization bug in i686-apple-darwin9-g
+ // without volatile, the optimizer (-O2) seems to do the wrong thing (tm
+ // the d->m_buttons array with an invalid argument.
+ volatile int prevIndex = i - 1;
+ button->stackUnder(d->m_buttons[prevIndex]);
+ }
}
}
}