aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-08-09 09:34:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-08-09 09:34:24 +0200
commit4ce9366b563ceb4939403dbf498b6a5126661ee0 (patch)
tree38f5c04387fc4cd487ebb20127f97c8415958003
parentc2b4305349ca855c497904282db354de56c74842 (diff)
Fix issue with concatenating empty typed LHS
-rw-r--r--build2/parser.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index d2cf38a..caf970e 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -3510,10 +3510,21 @@ namespace build2
if (!vnull)
{
- untypify (rhs);
+ if (vtype != nullptr)
+ untypify (rhs);
+
names& d (rhs.as<names> ());
- assert (d.size () == 1); // Must be single value.
- concat_data = move (d[0]);
+
+ // If the value is empty, then untypify() will (typically; no pun
+ // intended) represent it as an empty sequence of names rather than
+ // a sequence of one empty name. This is usually what we need (see
+ // simple_reverse() for details) but not in this case.
+ //
+ if (!d.empty ())
+ {
+ assert (d.size () == 1); // Must be a single value.
+ concat_data = move (d[0]);
+ }
}
};