diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-12 13:47:34 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-13 07:04:29 +0200 |
commit | 058172c6f9beb666e74d3e17a79f60aed8ff72bd (patch) | |
tree | 6bfa15da9cfed35042a4a2ad4e8230aecd2ff9f1 /src/qml/compiler/qv4jsir.cpp | |
parent | 12520389e91b73b47fb2006b7c7623285c9450c5 (diff) |
Fix leaks in Phi nodes in the V4 IR
The phi nodes store a QVector, but as the destructors of the IR nodes aren't
called, the QVector internal data is leaked. This patch re-uses the existing
Stmt::Data mechanism that was introduced to serve exactly that purpose. It
replaces the now unused QVectors there with the Phi::incoming vector and
adjusts usage accordingly.
Change-Id: I22f351a17c1983637b54fa73a93dd40d64fec46c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir.cpp')
-rw-r--r-- | src/qml/compiler/qv4jsir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp index fcaf1a0321..aea696dcda 100644 --- a/src/qml/compiler/qv4jsir.cpp +++ b/src/qml/compiler/qv4jsir.cpp @@ -581,11 +581,11 @@ void Phi::dump(QTextStream &out, Stmt::Mode mode) { targetTemp->dump(out); out << " = phi("; - for (int i = 0, ei = incoming.size(); i < ei; ++i) { + for (int i = 0, ei = d->incoming.size(); i < ei; ++i) { if (i > 0) out << ", "; - if (incoming[i]) - incoming[i]->dump(out); + if (d->incoming[i]) + d->incoming[i]->dump(out); } out << ");"; } |