From a0494a2092d7512a2b0d568a21058ed77b0cea11 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 17 Jan 2014 11:45:37 +0100 Subject: V4: fix range splitting when split is between intervals. Also added some "white-box" unit tests and sprinkled in a bit of documentation. The case that went wrong is covered by the test rangeSplitting_1: before the fix, the new interval would have two ranges: [66-64],[70-71]. The first range is invalid and should not be there at all. Change-Id: If0742f4e6a96d98ea5d696f95126886ba66f92bb Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4regalloc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4regalloc.cpp') diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp index 3521d0c27a..048aad8497 100644 --- a/src/qml/compiler/qv4regalloc.cpp +++ b/src/qml/compiler/qv4regalloc.cpp @@ -913,8 +913,9 @@ private: } } if (!moveFrom) { +#if defined(QT_NO_DEBUG) Q_UNUSED(lifeTimeHole); -#if !defined(QT_NO_DEBUG) +#else Q_ASSERT(!_info->isPhiTarget(it->temp()) || it->isSplitFromInterval() || lifeTimeHole); if (_info->def(it->temp()) != successorStart && !it->isSplitFromInterval()) { const int successorEnd = successor->statements.last()->id; @@ -1492,6 +1493,7 @@ int RegisterAllocator::nextUse(const Temp &t, int startPosition) const static inline void insertSorted(QVector &intervals, const LifeTimeInterval &newInterval) { + newInterval.validate(); for (int i = 0, ei = intervals.size(); i != ei; ++i) { if (LifeTimeInterval::lessThan(newInterval, intervals.at(i))) { intervals.insert(i, newInterval); -- cgit v1.2.3