aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-18 17:28:21 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-22 07:05:00 +0200
commit1e94466b06190061a86e9918c5e45279171e600f (patch)
tree6496f4b37c0ee6de24d16554933b7e345af9340e /src/qml/qml/qqmlincubator.cpp
parenta9bf6e652aa99784343c94b0181c9443205e2a82 (diff)
QQmlIncubationController: remove a possible signed integer overflow
Port incubateFor / incubateWhile to qint64. Since the implementation was doing calculations in nanoseconds, a few seconds incubation was sufficient to cause an int overflow. Change-Id: Iba68260a1fd62613aec17ba990ead221c0f7da10 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r--src/qml/qml/qqmlincubator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index d9c965d3ea..4911cd2879 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -403,7 +403,7 @@ void QQmlIncubationController::incubateFor(int msecs)
if (!d || !d->incubatorCount)
return;
- QQmlInstantiationInterrupt i(msecs * 1000000);
+ QQmlInstantiationInterrupt i(msecs * Q_INT64_C(1000000));
i.reset();
do {
static_cast<QQmlIncubatorPrivate*>(d->incubatorList.first())->incubate(i);
@@ -422,7 +422,7 @@ void QQmlIncubationController::incubateWhile(volatile bool *flag, int msecs)
if (!d || !d->incubatorCount)
return;
- QQmlInstantiationInterrupt i(flag, msecs * 1000000);
+ QQmlInstantiationInterrupt i(flag, msecs * Q_INT64_C(1000000));
i.reset();
do {
static_cast<QQmlIncubatorPrivate*>(d->incubatorList.first())->incubate(i);
@@ -447,7 +447,7 @@ void QQmlIncubationController::incubateWhile(std::atomic<bool> *flag, int msecs)
if (!d || !d->incubatorCount)
return;
- QQmlInstantiationInterrupt i(flag, msecs * 1000000);
+ QQmlInstantiationInterrupt i(flag, msecs * Q_INT64_C(1000000));
i.reset();
do {
static_cast<QQmlIncubatorPrivate*>(d->incubatorList.first())->incubate(i);