summaryrefslogtreecommitdiff
path: root/src/graph.cc
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2013-06-03 16:56:46 -0700
committerNico Weber <nicolasweber@gmx.de>2013-06-03 18:56:49 -0700
commitca0f379c27aa4887dbc63e3af71a6ebc687649e0 (patch)
treeb17b85ddc1963e0788b893d91a3c4862b080cd04 /src/graph.cc
parent0f53fd302b58589626dce073a0cd94061fac1355 (diff)
downloadninja-ca0f379c27aa4887dbc63e3af71a6ebc687649e0.tar.gz
Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.
No functionality change. Related to issue #590.
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 7a57753..fdd93de 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -417,9 +417,10 @@ bool ImplicitDepLoader::LoadDepsFromLog(Edge* edge, TimeStamp* deps_mtime,
vector<Node*>::iterator implicit_dep =
PreallocateSpace(edge, deps->node_count);
for (int i = 0; i < deps->node_count; ++i, ++implicit_dep) {
- *implicit_dep = deps->nodes[i];
- deps->nodes[i]->AddOutEdge(edge);
- CreatePhonyInEdge(*implicit_dep);
+ Node* node = deps->nodes[i];
+ *implicit_dep = node;
+ node->AddOutEdge(edge);
+ CreatePhonyInEdge(node);
}
return true;
}