summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Iannucci <robbie@rail.com>2013-03-18 16:53:53 (GMT)
committerRobert Iannucci <robbie@rail.com>2013-03-18 16:53:53 (GMT)
commit72b3dae6aa936e9eabf4c22e5602c572a9756cbe (patch)
tree8160f4b5ac765ebec4152286cb88a4f3442e4ee7
parenta3bf38cac72303bf6a288c26ccc71b1ba9de2b47 (diff)
downloadNinja-72b3dae6aa936e9eabf4c22e5602c572a9756cbe.zip
Ninja-72b3dae6aa936e9eabf4c22e5602c572a9756cbe.tar.gz
Ninja-72b3dae6aa936e9eabf4c22e5602c572a9756cbe.tar.bz2
Fix duplicate edge Pool crash in the minimally invasive way
-rw-r--r--src/build.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/build.cc b/src/build.cc
index 701fa92..2910385 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -418,6 +418,12 @@ Edge* Plan::FindWork() {
void Plan::ScheduleWork(Edge* edge) {
Pool* pool = edge->pool();
if (pool->ShouldDelayEdge()) {
+ // The graph is not completely clean. Some Nodes have duplicate Out edges.
+ // We need to explicitly ignore these here, otherwise their work will get
+ // scheduled twice (see https://github.com/martine/ninja/pull/519)
+ if (ready_.count(edge)) {
+ return;
+ }
pool->DelayEdge(edge);
pool->RetrieveReadyEdges(&ready_);
} else {