From b3f6553294bf6455f6fbee542f6481436f62a460 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 29 Jul 2016 12:40:15 +0200 Subject: Fix bug in prerequisite iteration leave group support --- build2/target | 2 ++ build2/target.ixx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'build2') 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++. } } } -- cgit v1.1