aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-29 12:40:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-29 12:40:15 +0200
commitb3f6553294bf6455f6fbee542f6481436f62a460 (patch)
treeebedb18342f1bd946b9a62aadcc6eccc076d9ff6
parent32e2ccb82db1962c659c2dc53e39a74e1f8d3b97 (diff)
Fix bug in prerequisite iteration leave group support
-rw-r--r--build2/target2
-rw-r--r--build2/target.ixx4
2 files changed, 5 insertions, 1 deletions
diff --git a/build2/target b/build2/target
index dfc6abc..7a50a19 100644
--- a/build2/target
+++ b/build2/target
@@ -802,6 +802,8 @@ namespace build2
// will normally only be known once the caller searched and matched
// the group.
//
+ // Also, the enter/leave group support is full of ugly, special cases.
+ //
private:
void
switch_mode ();
diff --git a/build2/target.ixx b/build2/target.ixx
index 5cf5ca9..b9dfa48 100644
--- a/build2/target.ixx
+++ b/build2/target.ixx
@@ -57,7 +57,8 @@ namespace build2
if (k_ == nullptr && g_.count != 0) // Iterating over a normal group.
{
- if (++j_ > g_.count)
+ if (g_.members == nullptr || // leave_group()
+ ++j_ > g_.count)
g_.count = 0;
}
@@ -133,6 +134,7 @@ namespace build2
//
j_ = 0;
g_.count = 1;
+ g_.members = nullptr; // Ugly "special case signal" for operator++.
}
}
}