aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++.
}
}
}