From 59dec666d17fdd7c5394c3c081cf21381a8af07d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Oct 2018 11:33:13 +0200 Subject: Fix execute_direct() to handle "match failed" case --- build2/algorithm.cxx | 16 +++++++++++----- 1 file 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 ()) - 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 ()) + 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 { -- cgit v1.1