forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -363,8 +363,13 @@ void CrumblePath::resizeButtons()
|
|||||||
nextElementPosition.rx() += button->width() - ArrowBorderSize;
|
nextElementPosition.rx() += button->width() - ArrowBorderSize;
|
||||||
|
|
||||||
button->show();
|
button->show();
|
||||||
if (i > 0)
|
if (i > 0) {
|
||||||
button->stackUnder(d->m_buttons[i - 1]);
|
// 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]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user