From 75313e6fead3b82a4be2d37b341a735f7b61279b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Jun 2018 12:38:50 +0200 Subject: Add sanity check --- build2/algorithm.cxx | 2 ++ build2/target.hxx | 2 +- build2/target.ixx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index 6743907..7e68a36 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -439,6 +439,8 @@ namespace build2 const rule_match* r (match_impl (a, t, nullptr, try_match)); + assert (l.offset != target::offset_tried); // Should have failed. + if (r == nullptr) // Not found (try_match == true). { l.offset = target::offset_tried; diff --git a/build2/target.hxx b/build2/target.hxx index e4f65ff..761cb4e 100644 --- a/build2/target.hxx +++ b/build2/target.hxx @@ -507,7 +507,7 @@ namespace build2 protected: // Version that should be used during match after the target has been - // matched for this action (see the recipe override). + // matched for this action. // // Indicate whether there is a rule match with the first half of the // result (see try_match()). diff --git a/build2/target.ixx b/build2/target.ixx index 88bc530..6d69545 100644 --- a/build2/target.ixx +++ b/build2/target.ixx @@ -67,6 +67,8 @@ namespace build2 { assert (phase == run_phase::match); + // Note that the "tried" state is "final". + // const opstate& s (state[a]); size_t o (s.task_count.load (memory_order_relaxed) - // Synchronized. target::count_base ()); -- cgit v1.1