aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-08 11:05:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-08 11:05:57 +0200
commitcb2f3d92cae93f295c5cad544eccdad3ff187fac (patch)
treef703f5c21025fee5344334c503cf5f8171c50643
parent7d118a8292ad9fc3c9a4a90dc76eaef6e82fee84 (diff)
Fix bug in operation aliasing logic
-rw-r--r--build2/b.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index 9dc6f43..47cbef2 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -989,12 +989,9 @@ main (int argc, char* argv[])
if (o == 0)
o = default_id;
- // Before de-aliasing and/or translation (we assume in the check
- // below that those will be the same since we've verified the
- // meta-operation implementation is the same).
+ // Save the original oid before de-aliasing.
//
orig_oid = o;
-
oif = lookup (o);
l5 ([&]{trace << "start operation batch " << oif->name
@@ -1009,8 +1006,14 @@ main (int argc, char* argv[])
if (oif->id != oid)
{
+ // Update the original id (we assume in the check below that
+ // translation would have produced the same result since we've
+ // verified the meta-operation implementation is the same).
+ //
+ orig_oid = oid;
oif = lookup (oid);
oid = oif->id; // De-alias.
+
l5 ([&]{trace << "operation translated to " << oif->name
<< ", id " << static_cast<uint16_t> (oid);});
}