diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-07-17 15:57:52 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-18 12:20:21 +0200 |
commit | cc864b59e10358aa9470a0e03b16bd507bf02033 (patch) | |
tree | f7a7f5246f9d88146f02ae50ee46d1f7fe4b8cbd /src | |
parent | 44962c454392bc87cb2713323ccace5b322329cc (diff) |
fix occasional crash when applying dynamic rules
When creating the set of input artifacts we must not include compatible
artifacts that have been created by this rule.
This can e.g. happen for the ["cpp", "hpp"] to ["hpp", "cpp", "unmocable"]
rule and led to occasional crashes in TestBlackbox::track_qobject_change.
Change-Id: I8bf5e8285fa22c8ec89619fb7d3bec60b9797ef0
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/buildgraph/rulenode.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/rulenode.cpp b/src/lib/corelib/buildgraph/rulenode.cpp index dc9bbcb22..00454d080 100644 --- a/src/lib/corelib/buildgraph/rulenode.cpp +++ b/src/lib/corelib/buildgraph/rulenode.cpp @@ -148,8 +148,16 @@ ArtifactSet RuleNode::oldInputArtifacts() const ArtifactSet RuleNode::currentInputArtifacts() const { ArtifactSet s; - foreach (const FileTag &t, m_rule->inputs) - s += product->lookupArtifactsByFileTag(t); + foreach (const FileTag &t, m_rule->inputs) { + foreach (Artifact *artifact, product->lookupArtifactsByFileTag(t)) { + if (artifact->transformer && artifact->transformer->rule == m_rule) { + // Do not add compatible artifacts as inputs that were created by this rule. + // This can e.g. happen for the ["cpp", "hpp"] -> ["hpp", "cpp", "unmocable"] rule. + continue; + } + s += artifact; + } + } foreach (const ResolvedProductConstPtr &dep, product->dependencies) { if (!dep->buildData) |