aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-08-25 16:18:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-08-25 16:18:58 +0200
commit3cf8015a4941c43ae82100dc0d998945485d760c (patch)
tree0388fc33770bffb92fcc016bdb89487370a4ec8e /libbuild2/algorithm.ixx
parent190af1175755e2a76b1ac182414ae261a15bb276 (diff)
Fix bug in interaction of unmatch logic with target groups
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r--libbuild2/algorithm.ixx9
1 files changed, 7 insertions, 2 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 9d77d61..97a8519 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -322,12 +322,17 @@ namespace build2
if (s == target_state::failed)
throw failed ();
+ // If this is a member of the group then the state we've got is that of
+ // the group, not the member, while the member has matched the group and
+ // incremented its dependency counts. As a result, we cannot rely on the
+ // unchanged state in this case.
+ //
switch (um)
{
case unmatch::none: break;
case unmatch::unchanged:
{
- if (s == target_state::unchanged)
+ if (s == target_state::unchanged && t.group == nullptr)
return make_pair (true, s);
break;
@@ -338,7 +343,7 @@ namespace build2
// we never decrement this count during match so that someone else
// cannot change their mind).
//
- if (s == target_state::unchanged ||
+ if ((s == target_state::unchanged && t.group == nullptr) ||
t[a].dependents.load (memory_order_consume) != 0)
return make_pair (true, s);