aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4regalloc.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-11-12 11:29:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-12 14:40:22 +0100
commit4ed95774ed15f195da157c7c17a45e0c8c895054 (patch)
treeee6529ef983da38dd1b7be60e501f578dfd6055a /src/qml/compiler/qv4regalloc.cpp
parent2e8dfb5d5cd02cf2ca281f19bfb9966c97f35db7 (diff)
V4 JIT: fix invalid sanity assert.
If there are multiple incoming edges to a block, and there are one or more phi nodes at the start, then only check the temp uses for the edge we are resolving. Task-number: QTBUG-34770 Change-Id: Ibb5c7c323d6be8bc1ed492b08ed098de2f2726cc Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4regalloc.cpp')
-rw-r--r--src/qml/compiler/qv4regalloc.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp
index f746902814..9d1f12ec47 100644
--- a/src/qml/compiler/qv4regalloc.cpp
+++ b/src/qml/compiler/qv4regalloc.cpp
@@ -886,8 +886,28 @@ private:
#if !defined(QT_NO_DEBUG)
if (_info->def(it.temp()) != successorStart && !it.isSplitFromInterval()) {
const int successorEnd = successor->statements.last()->id;
- foreach (const Use &use, _info->uses(it.temp()))
- Q_ASSERT(use.pos < static_cast<unsigned>(successorStart) || use.pos > static_cast<unsigned>(successorEnd));
+ const int idx = successor->in.indexOf(predecessor);
+ foreach (const Use &use, _info->uses(it.temp())) {
+ if (use.pos == static_cast<unsigned>(successorStart)) {
+ // only check the current edge, not all other possible ones. This is
+ // important for phi nodes: they have uses that are only valid when
+ // coming in over a specific edge.
+ foreach (Stmt *s, successor->statements) {
+ if (Phi *phi = s->asPhi()) {
+ Q_ASSERT(it.temp().index != phi->targetTemp->index);
+ Q_ASSERT(phi->d->incoming[idx]->asTemp() == 0
+ || it.temp().index != phi->d->incoming[idx]->asTemp()->index);
+ } else {
+ // TODO: check that the first non-phi statement does not use
+ // the temp.
+ break;
+ }
+ }
+ } else {
+ Q_ASSERT(use.pos < static_cast<unsigned>(successorStart) ||
+ use.pos > static_cast<unsigned>(successorEnd));
+ }
+ }
}
#endif