QmlProfiler: Add some sanity checks to the various models

If we pop an event from the stack, then it should be the same type we
pushed earlier.

Change-Id: If4389cb57fa8996b3772fefca92d27c33dc35c65
Task-number: QTCREATORBUG-17885
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-03-20 16:19:48 +01:00
parent 572ea47e97
commit bdecee9feb
3 changed files with 11 additions and 4 deletions

View File

@@ -225,7 +225,8 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
break;
case RangeEnd: {
// update stats
QTC_ASSERT(!stack.isEmpty(), return);
QTC_ASSERT(stack.top().typeIndex() == event.typeIndex(), return);
QmlEventStats *stats = &d->data[event.typeIndex()];
qint64 duration = event.timestamp() - stack.top().timestamp();
stats->duration += duration;