aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-10-25 11:33:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-10-25 11:33:13 +0200
commit59dec666d17fdd7c5394c3c081cf21381a8af07d (patch)
tree775709b57ab5dd80c992b7189b18d7744ab4b362
parent8c637bf3530a92d8e22776e0dfda3df24f21e5d2 (diff)
Fix execute_direct() to handle "match failed" case
-rw-r--r--build2/algorithm.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index 75f7029..fbeb365 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -1567,16 +1567,22 @@ namespace build2
memory_order_acq_rel, // Synchronize on success.
memory_order_acquire)) // Synchronize on failure.
{
- if (s.state == target_state::unchanged)
+ if (s.state == target_state::unknown)
+ execute_impl (a, t);
+ else
{
- if (t.is_a<dir> ())
- execute_recipe (a, t, nullptr /* recipe */);
+ assert (s.state == target_state::unchanged ||
+ s.state == target_state::failed);
+
+ if (s.state == target_state::unchanged)
+ {
+ if (t.is_a<dir> ())
+ execute_recipe (a, t, nullptr /* recipe */);
+ }
s.task_count.store (exec, memory_order_release);
sched.resume (s.task_count);
}
- else
- execute_impl (a, t);
}
else
{